forked from johndbritton/teleport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TPNetworkConnection.h
54 lines (35 loc) · 1.24 KB
/
TPNetworkConnection.h
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
52
53
54
//
// TPNetworkConnection.h
// teleport
//
// Created by JuL on Mon Dec 29 2003.
// Copyright (c) 2003-2005 abyssoft. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "TPHost.h"
@class TPMessage, TPRemoteHost;
@class TPTransfersManager, TPTransfer;
@interface TPNetworkConnection : NSObject
{
TPTCPSocket * _socket;
NSMutableArray * _pendingMessages;
TPRemoteHost * _connectedHost;
TPHostCapability _capabilities;
NSMutableData * _msgBuffer;
TPTransfersManager * _transfersManager;
id _delegate;
}
- (instancetype) initWithSocket:(TPTCPSocket*)socket NS_DESIGNATED_INITIALIZER;
@property (nonatomic, readonly, strong) TPTCPSocket *socket;
@property (nonatomic, readonly, strong) TPTransfersManager *transfersManager;
@property (nonatomic, strong) TPRemoteHost *connectedHost;
- (BOOL)isValidForHost:(TPRemoteHost*)host;
@property (nonatomic, readonly) TPHostCapability localHostCapabilities;
@property (nonatomic, unsafe_unretained) id delegate;
- (void)disconnect;
- (BOOL)sendMessage:(TPMessage*)message;
@end
@interface NSObject (TPNetworkConnection_delegate)
- (void)connectionDisconnected:(TPNetworkConnection*)connection;
- (void)connection:(TPNetworkConnection*)connection receivedMessage:(TPMessage*)message;
@end