X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/ee6e3ba1019fb96ea727f0e83e873eef7f85510f..14a301f7aa7b244c4831006cfc4cfa42185517a4:/ShowcaseController.m diff --git a/ShowcaseController.m b/ShowcaseController.m index 00fb696..5a775c7 100755 --- a/ShowcaseController.m +++ b/ShowcaseController.m @@ -7,21 +7,34 @@ // #import "ShowcaseController.h" +#import "ITInetSocket.h" +ITInetSocket *sock; @implementation ShowcaseController - (void)awakeFromNib { - - ITInetServerSocket *sock = [[ITInetServerSocket alloc] initWithDelegate:self]; + sock = [[ITInetSocket alloc] initWithDelegate:self]; NSLog(@"rawr?"); - [sock setPort:4776]; - [sock setServiceName:@"Test Rendezvous Service"]; - [sock setServiceType:@"ittest" useForPort:NO]; - [sock start]; + [sock connectToHost:@"irc.freenode.net" onPort:6667]; } -- (void)newClientJoined:(ITInetSocket*)client +- (void) finishedConnecting:(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; +} @end