discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRunLoop questions


From: Richard Frith-Macdonald
Subject: Re: NSRunLoop questions
Date: Mon, 17 Dec 2001 20:20:05 +0000

On Monday, December 17, 2001, at 07:01 PM, Jay McCarthy wrote:

So, I read up the NSFileHandle headers and source and started
experimenting with and I've hit a wall.

Currently my code is this (pardon my massive copy+paste, but my original
explanation that i wrote was basically the code so i figured it would be
better to have the code) -

Yes ... but it would have been better to have the real code ... ie the full thing.
with fragments of code it's difficult to tell whether something has been
missed out in your original, or just in the code you posted. I'll assume you
posted something pretty complete though.


The problem I'm having is that once I make two connections to
127.0.0.1:9999 - the second one is immediately disconnected :
~/GNUstep/Development/Projects $ telnet 127.0.0.1 9999
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Welcome
Connection closed by foreign host.
~/GNUstep/Development/Projects $
While the first one does just what I need.

Based on the code you posted ... I would expect each socket to be
closed almost immediately, since you don't retain the handles, and when
each handle gets released the associated socket will be closed.

As you are doing a foreground write (writeData:) rather than a background
one, I would expect the welcome message to be written before the socket
is closed.

Apart from that, nothing really springs out as an obvious problem.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]