X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/c9e0098808889b595086f244439485d1787f65ee..1d23d1181a753fffef7a9d28db4b0b0546bd0032:/ShowcaseController.m diff --git a/ShowcaseController.m b/ShowcaseController.m index c1eef3c..d121bb6 100755 --- a/ShowcaseController.m +++ b/ShowcaseController.m @@ -8,28 +8,40 @@ #import "ShowcaseController.h" #import "ITInetSocket.h" +#import +#import @implementation ShowcaseController - (void)awakeFromNib { - - ITInetSocket *sock = [[ITInetSocket alloc] initWithDelegate:self]; - NSLog(@"rawr?"); - [sock connectToHost:@"66.111.58.80" onPort:4336]; + 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) finishedConnecting:(in ITInetSocket *)sender { - NSLog(@"Done connectin'"); - NSData *d = [NSData dataWithBytesNoCopy:"M00f!" length:5]; - [sender->writePipe writeData:d]; +- (void) dataReceived:(ITInetSocket *)sender +{ } -- (void) errorOccured:(ITInetSocketError)err during:(ITInetSocketState)state onSocket:(in ITInetSocket*)sender {NSLog(@"wtf");[sender retryConnection];} -- (void) dataReceived:(in ITInetSocket *)sender + +- (void) newDataAdded:(ITByteStream*)sender { - ITByteStream *p = sender->readPipe; - NSData *d = [p readAllData]; - NSLog(@"%@",d); + } +- (void)newClientJoined:(ITInetSocket*)client +{ + +} @end