Now it crashes!
authorAlexander Strange <astrange@ithinksw.com>
Mon, 17 Mar 2003 00:02:44 +0000 (00:02 +0000)
committerAlexander Strange <astrange@ithinksw.com>
Mon, 17 Mar 2003 00:02:44 +0000 (00:02 +0000)
ITByteStream.h
ITInetSocket.m
ShowcaseController.m

index eeb9c76..027e326 100755 (executable)
@@ -12,6 +12,7 @@
  */
 
 @interface ITByteStream : NSObject {
+    @public
     NSMutableData *data;
     @private
     NSLock *lock;
index 0719779..c51c05a 100755 (executable)
     [(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];
index c1eef3c..f3709a3 100755 (executable)
 @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