ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbTcp.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
#include <netdb.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/resource.h>
#include <sys/wait.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <ngc/core/ngcbSocket.h>

Macros

#define _GNU_SOURCE
 
#define _REENTRANT
 

Functions

int ngcbTcpService (const char *service, char *erms)
 
int ngcbTcpAccept (int fd, char *erms)
 
int ngcbTcpConnect (const char *service, char *erms)
 
int ngcbTcpConnectTmo (const char *service, int tmo, char *erms)
 
int ngcbTcpClose (int fd)
 
int ngcbTcpRead (int fd, void *buffer, size_t size, char *erms)
 
int ngcbTcpWrite (int fd, const void *buffer, size_t size, char *erms)
 

Detailed Description

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ _REENTRANT

#define _REENTRANT

Function Documentation

◆ ngcbTcpAccept()

int ngcbTcpAccept ( int fd,
char * erms )

Accept a tcp/ip client connection request and return the client socket.

◆ ngcbTcpClose()

int ngcbTcpClose ( int fd)

Close tcp/ip socket.

◆ ngcbTcpConnect()

int ngcbTcpConnect ( const char * service,
char * erms )

Connect to a tcp/ip socket service specified in the format "host:port". The function returns a client socket descriptor.

◆ ngcbTcpConnectTmo()

int ngcbTcpConnectTmo ( const char * service,
int tmo,
char * erms )

Cnnects to a tcp/ip socket service specified in the format "host:port". The function returns a client socket descriptor. The connect timeout is given in seconds. Zero or a negavitve number falls back to the default connection timeout as provided by the OS.

◆ ngcbTcpRead()

int ngcbTcpRead ( int fd,
void * buffer,
size_t size,
char * erms )

Read size bytes of from tcp/ip socket into buffer.

◆ ngcbTcpService()

int ngcbTcpService ( const char * service,
char * erms )

Open a tcp/ip server socket.

◆ ngcbTcpWrite()

int ngcbTcpWrite ( int fd,
const void * buffer,
size_t size,
char * erms )

Write size bytes of buffer to tcp/ip socket.