pazpar2  1.6.31
Data Structures | Functions | Variables
connection.c File Reference

Z39.50 connection (low-level client) More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <assert.h>
#include <yaz/log.h>
#include <yaz/comstack.h>
#include <yaz/tcpip.h>
#include "connection.h"
#include "session.h"
#include "host.h"
#include "client.h"
#include "settings.h"

Go to the source code of this file.

Data Structures

struct  connection
 Represents a physical, reusable connection to a remote Z39.50 host. More...

Functions

static int connection_use (int delta)
int connections_count (void)
static int connection_connect (struct connection *con, iochan_man_t iochan_man)
static int connection_is_idle (struct connection *co)
ZOOM_connection connection_get_link (struct connection *co)
static void remove_connection_from_host (struct connection *con)
static void connection_destroy (struct connection *co)
static struct connectionconnection_create (struct client *cl, struct host *host, int operation_timeout, int session_timeout, iochan_man_t iochan_man)
static void non_block_events (struct connection *co)
void connection_continue (struct connection *co)
static void connection_handler (IOCHAN iochan, int event)
static void connection_release (struct connection *co)
void connect_resolver_host (struct host *host, iochan_man_t iochan_man)
static struct hostconnection_get_host (struct connection *con)
int client_prep_connection (struct client *cl, int operation_timeout, int session_timeout, iochan_man_t iochan_man, const struct timeval *abstime)

Variables

static YAZ_MUTEX g_mutex = 0
static int no_connections = 0
static int total_no_connections = 0

Detailed Description

Z39.50 connection (low-level client)

Definition in file connection.c.

Function Documentation

int client_prep_connection ( struct client cl,
int  operation_timeout,
int  session_timeout,
iochan_man_t  iochan_man,
const struct timeval *  abstime 
)
void connect_resolver_host ( struct host host,
iochan_man_t  iochan_man 
)
static int connection_connect ( struct connection con,
iochan_man_t  iochan_man 
)
static
void connection_continue ( struct connection co)
static struct connection* connection_create ( struct client cl,
struct host host,
int  operation_timeout,
int  session_timeout,
iochan_man_t  iochan_man 
)
staticread
static void connection_destroy ( struct connection co)
static
static struct host* connection_get_host ( struct connection con)
staticread

Definition at line 396 of file connection.c.

References connection::host.

Referenced by connection_connect().

ZOOM_connection connection_get_link ( struct connection co)

Definition at line 124 of file connection.c.

References connection::link.

Referenced by client_record_response(), client_search_response(), and client_start_search().

static void connection_handler ( IOCHAN  iochan,
int  event 
)
static
static int connection_is_idle ( struct connection co)
static

Definition at line 107 of file connection.c.

References connection::Conn_Open, connection::link, and connection::state.

Referenced by client_prep_connection().

static void connection_release ( struct connection co)
static

Definition at line 342 of file connection.c.

References connection::client, and client_set_connection().

Referenced by client_prep_connection().

static int connection_use ( int  delta)
static

Definition at line 56 of file connection.c.

References g_mutex, no_connections, and total_no_connections.

Referenced by connection_create(), connection_destroy(), and connections_count().

int connections_count ( void  )

Definition at line 74 of file connection.c.

References connection_use().

static void non_block_events ( struct connection co)
static
static void remove_connection_from_host ( struct connection con)
static

Variable Documentation

YAZ_MUTEX g_mutex = 0
static

Definition at line 52 of file connection.c.

Referenced by connection_use().

int no_connections = 0
static

Definition at line 53 of file connection.c.

Referenced by connection_use().

int total_no_connections = 0
static

Definition at line 54 of file connection.c.

Referenced by connection_use().