About sockets...
About sockets...
- Subject: About sockets...
- From: malcom <email@hidden>
- Date: Mon, 27 May 2002 16:12:54 +0200
Hi again...
Heheh I think that I will send many message to the list before to make a
good client...first of all a big thanx to all people that want to help me in
this list.
Now my problem is with Small Sockets (or OmniNetwork)...
I receive a ping timedout message from the software... All seems right...
But... I receive all the data only when the other side is disconnected!
2002-05-27 16:09:31.836 clIRC[370] data: ERROR :Closing Link:
cx[email@hidden] (Ping timeout)
It's strange... I would to receive every single line of data when It's
really sended to me, and not at the end of connection... I think that there
is some thread problems with the sockets... Some time ago I have readed from
this list a similar message...but I can't found it now.
There is the code (again! hihih):
#import <Cocoa/Cocoa.h>
#import "Socket.h"
int main(int argc, const char *argv[])
{
Socket *socket;
NSString *stringa;
NSMutableData* response;
NSString* responseString;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NS_DURING
stringa = [NSString stringWithFormat:@"NICK cx\n\rUSER dani . . :ciao"];
socket = [[Socket alloc] init];
[socket connectToHostName: @"irc.edisontel.it" port: 6667];
[socket writeString: stringa];
response = [[[NSMutableData alloc] init] autorelease];
/* 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: %@",responseString);
NS_HANDLER
NS_ENDHANDLER
return NSApplicationMain(argc, argv);
[pool release];
}
_______________________________________________
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.