X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/14a301f7aa7b244c4831006cfc4cfa42185517a4..1d23d1181a753fffef7a9d28db4b0b0546bd0032:/ShowcaseController.m diff --git a/ShowcaseController.m b/ShowcaseController.m index 5a775c7..d121bb6 100755 --- a/ShowcaseController.m +++ b/ShowcaseController.m @@ -8,33 +8,40 @@ #import "ShowcaseController.h" #import "ITInetSocket.h" +#import +#import -ITInetSocket *sock; @implementation ShowcaseController - (void)awakeFromNib { - sock = [[ITInetSocket alloc] initWithDelegate:self]; - NSLog(@"rawr?"); - [sock connectToHost:@"irc.freenode.net" onPort:6667]; + server = [[ITInetServerSocket alloc] initWithDelegate:self]; + [server setPort:1338]; + [server setServiceType:@"ittest" useForPort:NO]; + [server setServiceName:[(NSString*)SCDynamicStoreCopyComputerName(NULL,NULL) autorelease]]; + [server start]; + [ITInetSocket startAutoconnectingToService:@"ittest" delegate:self]; } - (void) finishedConnecting:(ITInetSocket *)sender { + [sender disconnect]; +} +- (void) errorOccured:(ITInetSocketError)err during:(ITInetSocketState)state onSocket:(in ITInetSocket*)sender +{ } -- (void) errorOccured:(ITInetSocketError)err during:(ITInetSocketState)state onSocket:(in ITInetSocket*)sender {NSLog(@"wtf");[sender retryConnection];} - (void) dataReceived:(ITInetSocket *)sender { } -- (void) newDataAdded:(ITByteStream*)sender { - static int firstTime = YES; - NSString *ircini = @"USER m0nk3ys . . :Not Telling\r\nNICK ITFTest\r\n", *irc2 = @"JOIN #iThink\r\nPRIVMSG #iThink :w00t\r\nQUIT :!\r\n"; - NSLog(@"Writing something"); - NSData *d = [NSData dataWithBytes:[firstTime?ircini:irc2 cString] length:[firstTime?ircini:irc2 length]]; - [sock->writePipe writeData:d]; - NSLog(@"Reading something"); - firstTime = NO; +- (void) newDataAdded:(ITByteStream*)sender +{ + +} + +- (void)newClientJoined:(ITInetSocket*)client +{ + } @end