From: Alexander Strange Date: Mon, 17 Mar 2003 00:02:44 +0000 (+0000) Subject: Now it crashes! X-Git-Tag: v0.1~32 X-Git-Url: http://git.ithinksw.org/ITFoundation.git/commitdiff_plain/f7db9c0e898822c50164af5abda849c16410e035?ds=inline;hp=c9e0098808889b595086f244439485d1787f65ee Now it crashes! --- diff --git a/ITByteStream.h b/ITByteStream.h index eeb9c76..027e326 100755 --- a/ITByteStream.h +++ b/ITByteStream.h @@ -12,6 +12,7 @@ */ @interface ITByteStream : NSObject { + @public NSMutableData *data; @private NSLock *lock; diff --git a/ITInetSocket.m b/ITInetSocket.m index 0719779..c51c05a 100755 --- a/ITInetSocket.m +++ b/ITInetSocket.m @@ -237,13 +237,13 @@ [(id)dp finishedConnecting:self]; lstart: - while (!actionflag && ![writePipe availableDataLength]) + while (!actionflag && ![writePipe availableDataLength] && !dieflag) { NSData *d; readLen = recv(sockfd,buf,bufs,0); if (readLen) { d = [NSData alloc]; - [d initWithBytesNoCopy:buf length:readLen]; + [d initWithBytesNoCopy:buf length:readLen freeWhenDone:NO]; [readPipe writeData:d]; [d release]; [(id)dp dataReceived:self]; diff --git a/ShowcaseController.m b/ShowcaseController.m index c1eef3c..f3709a3 100755 --- a/ShowcaseController.m +++ b/ShowcaseController.m @@ -13,16 +13,17 @@ @implementation ShowcaseController - (void)awakeFromNib { - ITInetSocket *sock = [[ITInetSocket alloc] initWithDelegate:self]; NSLog(@"rawr?"); - [sock connectToHost:@"66.111.58.80" onPort:4336]; + [sock connectToHost:@"irc.freenode.net" onPort:6667]; } - (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 dataWithBytesNoCopy:"M00f!" length:5]; + NSData *d = [NSData dataWithBytes:[ircini cString] length:[ircini length]]; [sender->writePipe writeData:d]; + NSLog(@"%@",sender->writePipe->data); } - (void) errorOccured:(ITInetSocketError)err during:(ITInetSocketState)state onSocket:(in ITInetSocket*)sender {NSLog(@"wtf");[sender retryConnection];} - (void) dataReceived:(in ITInetSocket *)sender