1 #include "opensrf/generic_utils.h"
8 //---------------------------------------------------------------
10 //---------------------------------------------------------------
16 //---------------------------------------------------------------
18 //---------------------------------------------------------------
23 #include <sys/socket.h>
24 #include <arpa/inet.h>
26 #include <netinet/in.h>
29 #ifndef TRANSPORT_SOCKET_H
30 #define TRANSPORT_SOCKET_H
32 /* how many characters we read from the socket at a time */
39 /* we maintain the socket information */
40 struct transport_socket_struct {
46 /* user_data may be anything. it's whatever you wish
47 to see showing up in the callback in addition to
48 the acutal character data*/
49 void (*data_received_callback) (void * user_data, char*);
51 typedef struct transport_socket_struct transport_socket;
53 int tcp_connect( transport_socket* obj );
54 int tcp_send( transport_socket* obj, const char* data );
55 int tcp_disconnect( transport_socket* obj );
56 int tcp_wait( transport_socket* obj, int timeout );
57 int tcp_connected( transport_socket* obj );
60 int set_fl( int fd, int flags );
61 int clr_fl( int fd, int flags );