Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SmallSockets



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 readData:response])
.. But the isConnected always returns TRUE even when the server has closed
the connection ...

--
Thomas Deniau




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.