2023-11-01 21:11:11 +00:00
|
|
|
// This file Copyright © Transmission authors and contributors.
|
2022-01-20 18:27:56 +00:00
|
|
|
// It may be used under the MIT (SPDX: MIT) license.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2007-09-16 01:02:06 +00:00
|
|
|
|
2022-04-29 22:51:40 +00:00
|
|
|
#import <Foundation/Foundation.h>
|
2007-09-16 01:02:06 +00:00
|
|
|
|
2022-11-12 03:29:48 +00:00
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
2023-04-15 21:33:43 +00:00
|
|
|
typedef NS_ENUM(NSUInteger, PortStatus) { //
|
|
|
|
PortStatusChecking,
|
|
|
|
PortStatusOpen,
|
|
|
|
PortStatusClosed,
|
|
|
|
PortStatusError
|
2021-08-07 07:27:56 +00:00
|
|
|
};
|
2007-09-16 01:02:06 +00:00
|
|
|
|
2022-05-10 14:54:39 +00:00
|
|
|
@protocol PortCheckerDelegate;
|
|
|
|
|
2007-09-16 01:02:06 +00:00
|
|
|
@interface PortChecker : NSObject
|
2017-01-24 17:53:16 +00:00
|
|
|
|
2023-04-15 21:33:43 +00:00
|
|
|
@property(nonatomic, readonly) PortStatus status;
|
2007-09-16 01:02:06 +00:00
|
|
|
|
2022-05-10 14:54:39 +00:00
|
|
|
- (instancetype)initForPort:(NSInteger)portNumber delay:(BOOL)delay withDelegate:(NSObject<PortCheckerDelegate>*)delegate;
|
2021-08-15 09:41:48 +00:00
|
|
|
- (void)cancelProbe;
|
2007-12-18 20:02:49 +00:00
|
|
|
|
2007-09-16 01:02:06 +00:00
|
|
|
@end
|
2022-05-10 14:54:39 +00:00
|
|
|
|
|
|
|
@protocol PortCheckerDelegate<NSObject>
|
|
|
|
|
|
|
|
- (void)portCheckerDidFinishProbing:(PortChecker*)portChecker;
|
|
|
|
|
|
|
|
@end
|
2022-11-12 03:29:48 +00:00
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|