• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Socket data incoming event?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Socket data incoming event?


  • Subject: Re: Socket data incoming event?
  • From: email@hidden
  • Date: Fri, 31 May 2002 13:00:47 -0700

I replied to your question on 27-May with complete source code to the answer to this question...

did you not get this email?

http://cocoa.mamasam.com/COCOADEV/2002/05/2/35242.php


On Friday, May 31, 2002, at 12:06 PM, malcom wrote:

All seems ok... But... How can I know automatically when a new data has
incoming with Small Sockets? How?


For example in this stupid method I use the while function to retrive data
until the socket buffer is empty... But it's not automatically...

{
Socket *socket;
NSString *stringa;
NSMutableData *response;
NSString *responseString;

NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NS_DURING
socket = [[Socket alloc] init];
stringa = [NSString stringWithFormat: @"NICK djl\r\nUSER kkdf . .
:ciao\r\n"];

[socket connectToHostName : @"irc.tin.it" port: 6667];
[socket writeString: stringa];

response = [[[NSMutableData alloc] init] autorelease];
[socket readData:response];


while ( [socket readData:response] )
{
[socket readData:response];
responseString = [[[NSString alloc] initWithData:response
encoding:[NSString
defaultCStringEncoding]] autorelease];

NSLog(@"*** %@",responseString);
}

NS_HANDLER
NS_ENDHANDLER
[pool release];
return NSApplicationMain(argc, argv);
}


Thanx a lot for the help!
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.
_______________________________________________
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.

References: 
 >Socket data incoming event? (From: malcom <email@hidden>)

  • Prev by Date: Greetings and a question...
  • Next by Date: Re: Getting font info
  • Previous by thread: Socket data incoming event?
  • Next by thread: Getting font info
  • Index(es):
    • Date
    • Thread