--- lbbs/src/netio.c 2004/10/19 03:28:44 1.1 +++ lbbs/src/netio.c 2004/10/22 15:20:32 1.3 @@ -16,6 +16,8 @@ ***************************************************************************/ #include "common.h" +#include +#include char s_getc(int socket) @@ -28,6 +30,16 @@ s_getc(int socket) } int +s_putc(int socket, char c) +{ + int ret; + + ret = send (socket, &c, 1, 0); + + return ret; +} + +int s_receive(int socket, char* buffer, int buffer_length, char end_str[]) { char buf_str[2048]; @@ -65,8 +77,12 @@ s_receive(int socket, char* buffer, int int s_send(int socket, const char* in_str) { + int ret; + if (in_str != NULL && strlen(in_str) > 0) { - send(socket, in_str, strlen(in_str), 0); + ret = send(socket, in_str, strlen(in_str), 0); } + + return ret; }