-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMAAsyncSocketListener.h
More file actions
51 lines (35 loc) · 1.05 KB
/
MAAsyncSocketListener.h
File metadata and controls
51 lines (35 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// MAAsyncSocketListener.h
// MAAsyncIO
//
// Created by Michael Ash on 12/8/10.
// Copyright 2010 Michael Ash. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class MAAsyncReader;
@class MAAsyncWriter;
@class MAFDSource;
@interface MAAsyncSocketListener : NSObject
{
}
+ (id)listenerWithAddress: (NSData *)address error: (NSError **)error;
+ (id)listenerWith4and6WithPortRange: (NSRange)r tryRandom: (BOOL)tryRandomPorts error: (NSError **)error;
- (int)port;
- (void)setAcceptCallback: (void (^)(MAAsyncReader *reader, MAAsyncWriter *writer, NSData *peerAddress))block;
- (void)invalidate;
@end
@interface MAAsyncSimpleSocketListener : MAAsyncSocketListener
{
MAFDSource *_source;
int _fd;
int _port;
void (^_callback)(MAAsyncReader *reader, MAAsyncWriter *writer, NSData *peerAddress);
}
- (id)initWithAddress: (NSData *)address error: (NSError **)error;
@end
@interface MAAsyncCompoundSocketListener : MAAsyncSocketListener
{
NSMutableArray *_innerListeners;
}
- (void)addListener: (MAAsyncSocketListener *)listener;
@end