| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 1.91

 

socket_is_alive

#include "sflsock.h"
Bool
socket_is_alive (
    sock_t handle)

Synopsis

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.

Source Code - (sflsock.c)

{
#if (defined (DOES_SOCKETS))
    int
        socket_type,
        socket_type_size = sizeof (SOCKET),
        rc;

    rc = getsockopt ((SOCKET) handle, SOL_SOCKET, SO_TYPE,
                    (char *) &socket_type, &socket_type_size);
    return (rc == 0);
#else
    return (FALSE);
#endif
}

| << | < | > | >> iMatix Copyright © 1996-98 iMatix