| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sflsock.h" Bool socket_is_alive ( sock_t handle)
Returns TRUE if the socket is open. Returns FALSE if the socket is no longer accessible. You can use this function to check that a socket has not been closed by the other party, before doing reading or writing.
{ #if (defined (__UTYPE_BEOS)) /* BeOS 4.5 does not support the getsockopt() function */ int rc; rc = setsockopt ((SOCKET) handle, SOL_SOCKET, SO_NONBLOCK, (void *) &ip_nonblock, sizeof (ip_nonblock)); return (rc == 0); #elif (defined (DOES_SOCKETS)) int socket_type, rc; argsize_t socket_type_size = sizeof (SOCKET); rc = getsockopt ((SOCKET) handle, SOL_SOCKET, SO_TYPE, (char *) &socket_type, &socket_type_size); return (rc == 0); #else return (FALSE); #endif }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |