git.ithinksw.org
/
ITFoundation.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some mre debugging stuff, should be removed before rele
[ITFoundation.git]
/
ITInetSocket.h
diff --git
a/ITInetSocket.h
b/ITInetSocket.h
index
9f7d165
..
bcf30f5
100755
(executable)
--- a/
ITInetSocket.h
+++ b/
ITInetSocket.h
@@
-8,6
+8,7
@@
#import <Foundation/Foundation.h>
#import <netinet/in.h>
#import <Foundation/Foundation.h>
#import <netinet/in.h>
+#import <netdb.h>
enum {
ITInetMaxConnections = 36
enum {
ITInetMaxConnections = 36
@@
-15,12
+16,20
@@
enum {
typedef enum {
ITInetSocketConnecting,
typedef enum {
ITInetSocketConnecting,
- ITInetSocketReady,
+ ITInetSocketListening,
+ ITInetSocketReading,
+ ITInetSocketWriting,
ITInetSocketDisconnected
} ITInetSocketState;
ITInetSocketDisconnected
} ITInetSocketState;
+typedef enum {
+ ITInetHostNotFound,
+ ITInetConnectionDropped,
+ ITInetCouldNotConnect,
+} ITInetSocketError;
+
@protocol ITInetSocketOwner
@protocol ITInetSocketOwner
-- (void)
requestComplet
ed:(in NSData*)data;
+- (void)
dataReciev
ed:(in NSData*)data;
- (void) errorOccured:(int)err during:(ITInetSocketState)state;
- (void) finishedConnecting;
@end
- (void) errorOccured:(int)err during:(ITInetSocketState)state;
- (void) finishedConnecting;
@end
@@
-30,8
+39,8
@@
typedef enum {
int sockfd;
int port;
id delegate;
int sockfd;
int port;
id delegate;
- struct
sockaddr_in6 sa
;
- NS
MutableData *request
Buffer;
+ struct
addrinfo *ai
;
+ NS
Data *write
Buffer;
ITInetSocketState state;
}
// Init
ITInetSocketState state;
}
// Init
@@
-39,7
+48,6
@@
typedef enum {
-(id) initWithDelegate:(id)d;
-(void) connectToHost:(NSString*)host onPort:(short)port;
-(id) initWithDelegate:(id)d;
-(void) connectToHost:(NSString*)host onPort:(short)port;
-
-(ITInetSocketState) state;
@end
-(ITInetSocketState) state;
@end