Re: SmallSockets
Re: SmallSockets
- Subject: Re: SmallSockets
- From: Thomas Deniau <email@hidden>
- Date: Wed, 31 Oct 2001 12:16:05 +0100
Le 31/10/01 12:05, Kent Karlsson disait :
>
>
On onsdag, oktober 31, 2001, at 11:51 , Thomas Deniau wrote:
>
>
> Hi ! I'm using Steven Frank's Small Sockets to connect to an IRC server.
>
> But it seems that the while ( [socket readData:response] )
>
> loop
>
> keeps looping even when the server has closed the connection ...
>
>
The response is a allocated NSData with 0 length, not nil..
>
>
So change to:
>
>
while ([socket readData:response] && [response length])
No, because the IRC server may as well send me nothing during a few minutes
if nothing happens ... I want to know if the socket has been DISCONNECTED.
So I use while ([socket isConnected] && [socket read
Data:response])
.. But the isConnected always returns TRUE even when the server has closed
the connection ...
--
Thomas Deniau