Easy Socket libraryVersion: Easy Socket 0.1License: LGPL2 (see LICENSE) © 1999-2000, Erich Roncarolo
Bugs, contributes, mailing list and other informations at: Project administrator has changed: now mail to Karl T. Cooper
for any question.
|
||||
|
This library supplies some functions to bind and connect socket,
and to read and write variables of all simple types and strings.
It's written in C, but there is also an interface for PHP3.
In the library there are two function to bind and connect socket int easy_tcp_bind(char *host, int port, int backlog);that return a socket handler that can be used usually. There are also two functions to read and write each data type: <type> read_<type>(int sock);These functions works very well sending each datum as is through the socket. If reader and writer use, for example, integer of 16 bits (reader) and integer of 32 bits (writer) you should use another function: int write_<type>_c(int sock, <type> <data>);that convert data in a string of fixed size before send it. Then you can read data with: <type> read_<type>_c(int sock);that return a data of the correct type after reading the string. See easy_sock.h for functions details. Obviously, you can always use standard read() and write() functions: ssize_t read(int sock, void *buf, size_t count); Have a lot of fun!
|
|||
|