No new connections after exception on writeData:
No new connections after exception on writeData:
- Subject: No new connections after exception on writeData:
- From: Andreas Pardeike <email@hidden>
- Date: Tue, 15 Feb 2005 14:21:30 +0100
Hello,
I can't get my network code to listen again after the client
disconnected.
What I have done so far with success:
Using NSFileHandle to listen to incoming connections. Reading the
request
and sending out data. But when I call writeData: and the client is
already
gone then I get an exception and the posix error is 61. Here's the piece
of that code:
NS_DURING
[myStream writeData:buffer];
NS_HANDLER
NSLog(@"sending error - restart listening");
[myStream closeFile];
[myStream acceptConnectionInBackgroundAndNotify];
NS_ENDHANDLER
The problem: I never get any new connections again without stopping and
starting
the whole bind/listen cycle. On a second handle, I only receive data
and then
close the connection with closeFile &
acceptConnectionInBackgroundAndNotify and
there I am successfully receiving as many new requests as I want.
What am I doing wrong?
Regards,
Andreas Pardeike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden