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