1 #ifndef TRANSPORT_CLIENT_H
2 #define TRANSPORT_CLIENT_H
5 @file transport_client.h
6 @brief Header for implementation of transport_client.
8 The transport_client routines provide an interface for sending and receiving Jabber
9 messages, one at a time.
13 #include <opensrf/transport_session.h>
14 #include <opensrf/utils.h>
15 #include <opensrf/log.h>
21 struct message_list_struct;
24 @brief A collection of members used for keeping track of transport_messages.
26 Among other things, this struct includes a queue of incoming messages, and
27 a Jabber ID for outgoing messages.
29 struct transport_client_struct {
30 transport_message* msg_q_head; /**< Head of message queue */
31 transport_message* msg_q_tail; /**< Tail of message queue */
32 transport_session* session; /**< Manages lower-level message processing */
33 int error; /**< Boolean: true if an error has occurred */
34 char* host; /**< Domain name or IP address of the Jabber server */
35 char* xmpp_id; /**< Jabber ID used for outgoing messages */
37 typedef struct transport_client_struct transport_client;
39 transport_client* client_init( const char* server, int port, const char* unix_path, int component );
41 int client_connect( transport_client* client,
42 const char* username, const char* password, const char* resource,
43 int connect_timeout, enum TRANSPORT_AUTH_TYPE auth_type );
45 int client_disconnect( transport_client* client );
47 int client_free( transport_client* client );
49 int client_send_message( transport_client* client, transport_message* msg );
51 int client_connected( const transport_client* client );
53 transport_message* client_recv( transport_client* client, int timeout );