Small sockets, Autorelease etc...
Small sockets, Autorelease etc...
- Subject: Small sockets, Autorelease etc...
- From: malcom <email@hidden>
- Date: Sun, 26 May 2002 20:54:30 +0200
Hello at all,
I'm a cocoa newbie... I would to make an irc client using cocoa and obj-c. I
have downloaded SmallSockets framework from sourceforge.net.
This is the code to connect. I send a initial authenticatin message for now.
But there are some problems:
- some cocoa errors;
- the result message will be visibile only when the connection timed out by
server.
This is the messages:
******************************************************
2002-05-26 20:52:42.021 clIRC[341] *** _NSAutoreleaseNoPool(): Object
0x8ca30 of class NSCFString autoreleased with no pool in place - just
leaking
2002-05-26 20:52:42.029 clIRC[341] *** _NSAutoreleaseNoPool(): Object
0x8ff00 of class Socket autoreleased with no pool in place - just leaking
2002-05-26 20:52:42.357 clIRC[341] *** _NSAutoreleaseNoPool(): Object
0x6f550 of class NSConcreteMutableData autoreleased with no pool in place -
just leaking
2002-05-26 20:52:42.358 clIRC[341] *** _NSAutoreleaseNoPool(): Object
0x93540 of class NSConcreteMutableData autoreleased with no pool in place -
just leaking
2002-05-26 20:52:44.591 clIRC[341] *** _NSAutoreleaseNoPool(): Object
0x93600 of class NSCFString autoreleased with no pool in place - just
leaking
2002-05-26 20:52:44.591 clIRC[341] data: \\304\\026\\010\\304
*********************************************************
This is the main.c code:
*********************************************
#import <Cocoa/Cocoa.h>
#import "Socket.h"
int main(int argc, const char *argv[])
{
Socket *socket;
NSString *stringa;
NSMutableData* response;
NSString* responseString;
NS_DURING
stringa = [NSString stringWithFormat:@"NICK daniele\n\rUSER dani . .
:ciao"];
socket = [Socket socket];
socket = [[Socket alloc] init];
[socket connectToHostName: @"irc.edisontel.it" port: 6667];
[socket writeString: stringa];
response = [[[NSMutableData alloc] init] autorelease];
// [socket read
Data:response];
/* while ( [socket read
Data:response] )
{
// Read until other side disconnects
}*/
[socket read
Data:response];
responseString = [[[NSString alloc] initWith
Data:response
encoding:[NSString defaultCStringEncoding]]
autorelease];
NSLog(@"data: %s",responseString);
NS_HANDLER
NS_ENDHANDLER
return NSApplicationMain(argc, argv);
}
******************
Anyone can help me? Thanx a lot!
Bye,
malcom
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.