else {perror("Too bad I haven't implemented error checking yet");}
}
else {
- ITInetSocket *csocket = [[[ITInetSocket alloc] initWithFD:cfd delegate:self] autorelease];
+ ITInetSocket *csocket = [[ITInetSocket alloc] initWithFD:cfd delegate:self];
[clients addObject:csocket];
[delegate newClientJoined:csocket];
}
#import <Foundation/Foundation.h>
+@protocol ITInetSocketOwner
+- (void)requestCompleted:(NSString*)data;
+@end
-@interface ITInetSocket : NSObject {
+enum {
+ ITInetMaxConnections = 36;
+};
+@interface ITInetSocket : NSObject {
+ int sockfd;
+ int port;
+ NSString *destAddr;
}
--(id)initWithFD:(int)fd delegate:(id)d;
+// Init
+-(id) initWithFD:(int)fd;
+-(id) initWithFD:(int)fd delegate:(id)d;
+-(id) initWithDelegate:(id)d;
+
++(NSArray*) socketsForRendezvousScan; //need args
+
+// Mutators (some of these must be set before you can connect)
+-(void) setPort:(int)port;
+-(void) setPortViaServiceName:(NSString*)name;
+-(void) setDest:(NSString*)dst;
@end
@implementation ITInetSocket
-(id)initWithFD:(int)fd delegate:(id)d
{
- NSLog(@"Someone made a socket!");
return nil;
}
-
--(void)disconnect
-{
-}
@end