return client;
}
+
int client_connect( transport_client* client,
char* username, char* password, char* resource,
int connect_timeout, enum TRANSPORT_AUTH_TYPE auth_type ) {
password, resource, connect_timeout, auth_type );
}
+
int client_disconnect( transport_client* client ) {
if( client == NULL ) { return 0; }
return session_disconnect( client->session );
// ---------------------------------------------------------------------------
transport_client* client_init( char* server, int port, int component );
+
// ---------------------------------------------------------------------------
// Connects to the Jabber server with the provided information. Returns 1 on
// success, 0 otherwise.
char* username, char* password, char* resource,
int connect_timeout, enum TRANSPORT_AUTH_TYPE auth_type );
+
int client_disconnect( transport_client* client );
// ---------------------------------------------------------------------------
session->router_command_buffer = buffer_init( JABBER_JID_BUFSIZE );
-
if( session->body_buffer == NULL || session->subject_buffer == NULL ||
session->thread_buffer == NULL || session->from_buffer == NULL ||
session->status_buffer == NULL || session->recipient_buffer == NULL ||
return session;
}
+
+
/* XXX FREE THE BUFFERS */
int session_free( transport_session* session ) {
if( ! session ) { return 0; }
}
- /*
- session->state_machine->connected =
- tcp_connected( session->sock_obj );
-
- if( session->state_machine->connected ) {
- return 1;
- }
- */
-
-
char* server = session->sock_obj->server;
if( ! session->sock_obj ) {
struct hostent *hptr;
int sock_fd;
- #ifdef WIN32
- WSADATA data;
- char bfr;
- if( WSAStartup(MAKEWORD(1,1), &data) ) {
- fatal_handler( "somethin's broke with windows socket startup" );
- return -1;
- }
- #endif
-
-
// ------------------------------------------------------------------
// Create the socket
// ------------------------------------------------------------------