-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathYLConnection.h
50 lines (40 loc) · 1.2 KB
/
YLConnection.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
//
// YLConnection.h
// MacBlueTelnet
//
// Created by Lan Yung-Luen on 12/7/07.
// Copyright 2007 yllan.org. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "YLTerminal.h"
@class YLSite;
@protocol YLConnectionProtocol
- (void) close;
- (void) reconnect;
- (BOOL) connectToSite: (YLSite *)s;
- (BOOL) connectToAddress: (NSString *)addr;
- (BOOL) connectToAddress: (NSString *)addr port: (unsigned int)port;
- (void) receiveBytes: (unsigned char *)bytes length: (NSUInteger)length;
- (void) sendBytes: (unsigned char *)msg length: (NSInteger)length;
- (void) sendData: (NSData *)msg;
@property (retain) YLTerminal *terminal;
@property BOOL connected;
@property (copy) NSString *connectionName;
@property (copy) NSString *connectionAddress;
@property (retain) NSImage *icon;
@property BOOL isProcessing;
@property (retain) YLSite *site;
- (NSDate *) lastTouchDate;
@end
@interface YLConnection : NSObject <YLConnectionProtocol> {
NSString *_connectionName;
NSString *_connectionAddress;
NSImage *_icon;
BOOL _processing;
BOOL _connected;
NSDate *_lastTouchDate;
YLTerminal *_terminal;
YLSite *_site;
}
+ (YLConnection *) connectionWithAddress: (NSString *)addr;
@end