X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/f7db9c0e898822c50164af5abda849c16410e035..1d23d1181a753fffef7a9d28db4b0b0546bd0032:/ShowcaseController.m diff --git a/ShowcaseController.m b/ShowcaseController.m index f3709a3..d121bb6 100755 --- a/ShowcaseController.m +++ b/ShowcaseController.m @@ -8,29 +8,40 @@ #import "ShowcaseController.h" #import "ITInetSocket.h" +#import +#import @implementation ShowcaseController - (void)awakeFromNib { - ITInetSocket *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:(in ITInetSocket *)sender { - NSString *ircini = @"NICK ITFTest\r\nUSER m0nk3ys . . :Not Tellin'\r\nJOIN #iThink\r\nPRIVMSG #iThink :w00t\r\nQUIT :!\r\n"; - NSLog(@"Done connectin'"); - NSData *d = [NSData dataWithBytes:[ircini cString] length:[ircini length]]; - [sender->writePipe writeData:d]; - NSLog(@"%@",sender->writePipe->data); +- (void) finishedConnecting:(ITInetSocket *)sender { + [sender disconnect]; } -- (void) errorOccured:(ITInetSocketError)err during:(ITInetSocketState)state onSocket:(in ITInetSocket*)sender {NSLog(@"wtf");[sender retryConnection];} -- (void) dataReceived:(in ITInetSocket *)sender + +- (void) errorOccured:(ITInetSocketError)err during:(ITInetSocketState)state onSocket:(in ITInetSocket*)sender +{ +} + +- (void) dataReceived:(ITInetSocket *)sender +{ +} + +- (void) newDataAdded:(ITByteStream*)sender { - ITByteStream *p = sender->readPipe; - NSData *d = [p readAllData]; - NSLog(@"%@",d); + } +- (void)newClientJoined:(ITInetSocket*)client +{ + +} @end