Disabling socket build for now while I revise the APIs
[ITFoundation.git] / ITInetSocket.h
1 //
2 //  ITInetSocket.h
3 //  ITFoundation
4 //
5 //  Created by Alexander Strange on Tue Feb 11 2003.
6 //  Copyright (c) 2003 __MyCompanyName__. All rights reserved.
7 //
8
9 #import <Foundation/Foundation.h>
10 #import <netinet/in.h>
11
12 enum {
13     ITInetMaxConnections = 36
14 };
15
16 typedef enum {
17     ITInetSocketConnecting,
18     ITInetSocketReady,
19     ITInetSocketDisconnected
20 } ITInetSocketState;
21
22 @protocol ITInetSocketOwner
23 - (void) requestCompleted:(in NSData*)data;
24 - (void) errorOccured:(int)err during:(ITInetSocketState)state;
25 - (void) finishedConnecting;
26 @end
27
28 @interface ITInetSocket : NSObject {
29     @public
30     int sockfd;
31     int port;
32     id delegate;
33     struct sockaddr_in6 sa;
34     NSMutableData *requestBuffer;
35     ITInetSocketState state;
36 }
37 // Init
38 -(id) initWithFD:(int)fd delegate:(id)d;
39 -(id) initWithDelegate:(id)d;
40
41 -(void) connectToHost:(NSString*)host onPort:(short)port;
42
43 -(ITInetSocketState) state;
44
45 @end