--- Sebastian_Günther wrote: >
Show quoted text 20 lines
> There is another way, if you use file descriptor
calls
> for non-blocked socket:
>
> ...
> count:=fdRead(socket,data,size);
> socket_eof:=(count=0) and (LinuxError=0);
> ...
eeehm normally fdread returns -1 for closed sockets,
so you can obmit
the LinuxError part and just write:
socket_eof := count <= 0;
This will work both for files (where zero means EOF)
and sockets (where
-1 means error, such as broken pipe)
I think that if the socket (or file) is in nonblocking mode,
count may be -1, and LinuxError=11 { Err_TryAgain } means that connection is OK, but there is no incoming data
(input is not finished).
Show quoted text 8 lines
- Sebastian
_______________________________________________
fpc-pascal maillist -
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
=====
Skelet
====== http://skelet.hit.bg
________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://mail.messenger.yahoo.co.uk