/*************************************************************************** * * socket.c - routine for socket communcation * *************************************************************************** */ #define EXTERN /*-------------------------- * Standard include files *-------------------------- */ #include #include #include #include #include #include #include #include #include #if SUNOS | LINUX #include #endif #if LYNX #include #endif /*----------------------------- * Non-standard include files *----------------------------- */ #include "addlib.h" #include "errorlib/error_msg.h" /*----------------------------------------------------------------------- ** sock_write_msg() - writes a message to the socket fd. ** return: -1 error writing to sock. ** >0 number of bytes written. (will always write ** SOCKET_MSG_LEN bytes to stream.) **----------------------------------------------------------------------- */ #if ANSI int sock_write_msg( int fd, char *msg, int blocking ) #else int sock_write_msg( fd, msg, blocking ) int fd; /* Socket ID */ char * msg; /* Message to send to PC */ int blocking; /* specify blocking (TRUE) or non-blocking (FALSE) */ #endif { int len; if( ( len = sock_write_data(fd, msg, (long)SOCKET_MSG_LEN, blocking)) < 0 ) { len = ERR_SOCKET_ERR; } return len; }