YAZ
5.34.0
|
Implements socket-pipes. More...
#include <yaz/yconfig.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <yaz/xmalloc.h>
#include <yaz/nmem.h>
#include <yaz/log.h>
#include <yaz/spipe.h>
#include <fcntl.h>
Go to the source code of this file.
Data Structures | |
struct | yaz_spipe |
Macros | |
#define | YAZ_INVALID_SOCKET -1 |
#define | YAZ_SOCKLEN_T int |
Functions | |
static void | yaz_spipe_close (int *fd) |
static int | nonblock (int s) |
yaz_spipe_t | yaz_spipe_create (int port_to_use, WRBUF *err_msg) |
create socket pipe More... | |
void | yaz_spipe_destroy (yaz_spipe_t p) |
destroys socket pipe More... | |
int | yaz_spipe_get_read_fd (yaz_spipe_t p) |
returns reading socket More... | |
int | yaz_spipe_get_write_fd (yaz_spipe_t p) |
returns writing socket More... | |
Implements socket-pipes.
Definition in file spipe.c.
|
static |
Definition at line 88 of file spipe.c.
Referenced by yaz_spipe_create().
|
static |
Definition at line 76 of file spipe.c.
References YAZ_INVALID_SOCKET.
Referenced by yaz_spipe_create(), and yaz_spipe_destroy().
yaz_spipe_t yaz_spipe_create | ( | int | port_to_use, |
WRBUF * | err_msg | ||
) |
create socket pipe
port_to_use | port that we temporarily bind to |
err_msg | error message reference (0 if not to be set) |
Definition at line 101 of file spipe.c.
References yaz_spipe::m_fd, yaz_spipe::m_socket, nonblock(), wrbuf_printf(), xfree, xmalloc, YAZ_INVALID_SOCKET, YAZ_SOCKLEN_T, yaz_spipe_close(), and yaz_spipe_destroy().
void yaz_spipe_destroy | ( | yaz_spipe_t | p | ) |
destroys socket pipe
p | socket pipe pointer |
Definition at line 255 of file spipe.c.
References yaz_spipe::m_fd, yaz_spipe::m_socket, xfree, and yaz_spipe_close().
Referenced by yaz_spipe_create().
int yaz_spipe_get_read_fd | ( | yaz_spipe_t | p | ) |
returns reading socket
p | socket pipe pointer |
Definition at line 266 of file spipe.c.
References yaz_spipe::m_fd.
int yaz_spipe_get_write_fd | ( | yaz_spipe_t | p | ) |
returns writing socket
p | socket pipe pointer |
Definition at line 271 of file spipe.c.
References yaz_spipe::m_fd.