NCBI C++ ToolKit
Classes | Macros | Functions
ncbi_socket_connector.c File Reference
#include "ncbi_ansi_ext.h"
#include "ncbi_assert.h"
#include "ncbi_priv.h"
#include "ncbi_socketp.h"
#include <connect/ncbi_socket_connector.h>
#include <stdio.h>
#include <stdlib.h>
+ Include dependency graph for ncbi_socket_connector.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SSockConnector
 

Macros

#define NCBI_USE_ERRCODE_X   Connect_Socket
 
#define MAX_IP_ADDR_LEN   16 /* sizeof("255.255.255.255") */
 

Functions

static const char * x_GetType (SSockConnector *unused)
 
static char * x_Descr (SSockConnector *xxx)
 
static const char * s_VT_GetType (CONNECTOR connector)
 
static char * s_VT_Descr (CONNECTOR connector)
 
static EIO_Status s_VT_Open (CONNECTOR connector, const STimeout *timeout)
 
static EIO_Status s_VT_Wait (CONNECTOR connector, EIO_Event event, const STimeout *timeout)
 
static EIO_Status s_VT_Write (CONNECTOR connector, const void *buf, size_t size, size_t *n_written, const STimeout *timeout)
 
static EIO_Status s_VT_Read (CONNECTOR connector, void *buf, size_t size, size_t *n_read, const STimeout *timeout)
 
static EIO_Status s_VT_Status (CONNECTOR connector, EIO_Event dir)
 
static EIO_Status s_VT_Close (CONNECTOR connector, const STimeout *timeout)
 
static void s_Setup (CONNECTOR connector)
 
static void s_Destroy (CONNECTOR connector)
 
static CONNECTOR s_Init (SOCK sock, const char *host, unsigned short port, unsigned short try_own, const void *data, size_t size, TSOCK_Flags flags)
 
CONNECTOR SOCK_CreateConnector (const char *host, unsigned short port, unsigned short max_try)
 
CONNECTOR SOCK_CreateConnectorEx (const char *host, unsigned short port, unsigned short max_try, const void *data, size_t size, TSOCK_Flags flags)
 
CONNECTOR SOCK_CreateConnectorOnTop (SOCK sock, unsigned short own_sock)
 
CONNECTOR SOCK_CreateConnectorOnTopEx (SOCK sock, unsigned short own_sock, const char *hostport)
 

Macro Definition Documentation

◆ MAX_IP_ADDR_LEN

#define MAX_IP_ADDR_LEN   16 /* sizeof("255.255.255.255") */

Definition at line 47 of file ncbi_socket_connector.c.

◆ NCBI_USE_ERRCODE_X

#define NCBI_USE_ERRCODE_X   Connect_Socket

Definition at line 44 of file ncbi_socket_connector.c.

Function Documentation

◆ s_Destroy()

static void s_Destroy ( CONNECTOR  connector)
static

◆ s_Init()

static CONNECTOR s_Init ( SOCK  sock,
const char *  host,
unsigned short  port,
unsigned short  try_own,
const void *  data,
size_t  size,
TSOCK_Flags  flags 
)
static

◆ s_Setup()

static void s_Setup ( CONNECTOR  connector)
static

◆ s_VT_Close()

static EIO_Status s_VT_Close ( CONNECTOR  connector,
const STimeout timeout 
)
static

◆ s_VT_Descr()

static char * s_VT_Descr ( CONNECTOR  connector)
static

Definition at line 143 of file ncbi_socket_connector.c.

References SConnectorTag::handle, and x_Descr().

Referenced by s_Setup().

◆ s_VT_GetType()

static const char * s_VT_GetType ( CONNECTOR  connector)
static

Definition at line 136 of file ncbi_socket_connector.c.

References SConnectorTag::handle, and x_GetType().

Referenced by s_Setup().

◆ s_VT_Open()

static EIO_Status s_VT_Open ( CONNECTOR  connector,
const STimeout timeout 
)
static

◆ s_VT_Read()

static EIO_Status s_VT_Read ( CONNECTOR  connector,
void *  buf,
size_t  size,
size_t *  n_read,
const STimeout timeout 
)
static

◆ s_VT_Status()

static EIO_Status s_VT_Status ( CONNECTOR  connector,
EIO_Event  dir 
)
static

Definition at line 228 of file ncbi_socket_connector.c.

References assert, SConnectorTag::handle, SSockConnector::sock, and SOCK_Status().

Referenced by s_Setup().

◆ s_VT_Wait()

static EIO_Status s_VT_Wait ( CONNECTOR  connector,
EIO_Event  event,
const STimeout timeout 
)
static

◆ s_VT_Write()

static EIO_Status s_VT_Write ( CONNECTOR  connector,
const void *  buf,
size_t  size,
size_t *  n_written,
const STimeout timeout 
)
static

◆ x_Descr()

static char* x_Descr ( SSockConnector xxx)
static

Definition at line 79 of file ncbi_socket_connector.c.

References buf, SSockConnector::host, malloc(), and SSockConnector::port.

Referenced by s_VT_Descr(), and s_VT_Open().

◆ x_GetType()

static const char* x_GetType ( SSockConnector unused)
static

Definition at line 73 of file ncbi_socket_connector.c.

References g_kNcbiSockNameAbbr.

Referenced by s_VT_GetType(), and s_VT_Open().

Modified on Mon May 27 04:40:58 2024 by modify_doxy.py rev. 669887