ARB
Functions
arb_cs.h File Reference
#include "arb_core.h"
Include dependency graph for arb_cs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const chararb_gethostname ()
 
size_t arb_socket_read (int socket, char *ptr, size_t size)
 
ssize_t arb_socket_write (int socket, const char *ptr, size_t size)
 
GB_ERROR arb_open_socket (const char *name, bool do_connect, int *fd, char **filename_out)
 

Function Documentation

const char* arb_gethostname ( )

Definition at line 51 of file arb_cs.cxx.

References ARB_strdup(), buffer, and gethostname().

Referenced by arb_open_tcp_socket(), and GB_host_is_local().

size_t arb_socket_read ( int  socket,
char ptr,
size_t  size 
)
ssize_t arb_socket_write ( int  socket,
const char ptr,
size_t  size 
)
GB_ERROR arb_open_socket ( const char name,
bool  do_connect,
int fd,
char **  filename_out 
)

Opens and prepares a socket

If

Parameters
namebegins with ":", the remainder is shell expanded and a unix socket is created. If
containsno ":" it must be numeric, giving the TCPport number to open. If
containsa ":" in the middle, the first part is considered the hostname and the latter part the port.
namename of port {[<host>:]<port>|:<filename>}
do_connectconnect if true (client), otherwise bind (server)
*fdfile descriptor of opened socket (out) or 0 (never returns <0!)
filename_outfilename of unix socket (out) must be NULp or allocated (will be freed)
Returns
NULp if all went fine -> *fd>0 "" if could not connect -> *fd==0 otherwise error message -> *fd==0

Definition at line 124 of file arb_cs.cxx.

References arb_assert, arb_open_tcp_socket(), arb_open_unix_socket(), arb_shell_expand(), ARB_strdup(), error(), GB_incur_error(), and NULp.

Referenced by aisc_open(), gbcm_open_socket(), and open_aisc_server().