use posix sockets

This commit is contained in:
Jeff Hill
2003-03-20 20:00:22 +00:00
parent 0f5ab03eb0
commit 5fd1b028dd
9 changed files with 20 additions and 12 deletions

View File

@@ -636,7 +636,7 @@ void tcpiiu::shutdown ( epicsGuard <cacMutex > & guard )
// linux threads in recv() dont wakeup unless we also
// call shutdown ( close() by itself is not enough )
if ( oldState == iiucs_connected ) {
int status = ::shutdown ( this->sock, SD_BOTH );
int status = ::shutdown ( this->sock, SHUT_RDWR );
if ( status ) {
errlogPrintf ("CAC TCP socket shutdown error was %s\n",
SOCKERRSTR (SOCKERRNO) );

View File

@@ -183,7 +183,7 @@ void casStreamIO::forceDisconnect ()
{
if ( ! this->sockHasBeenClosed ) {
this->sockHasBeenClosed = true;
int status = ::shutdown ( this->sock, SD_BOTH );
int status = ::shutdown ( this->sock, SHUT_RDWR );
if ( status ) {
errlogPrintf ("CAC TCP socket shutdown error was %s\n",
SOCKERRSTR (SOCKERRNO) );

View File

@@ -68,8 +68,8 @@ typedef int osiSocklen_t;
#define SOCK_ENOTSOCK ENOTSOCK
#define SOCK_EBADF EBADF
#ifndef SD_BOTH
#define SD_BOTH 2
#ifndef SHUT_RDWR
#define SHUT_RDWR 2
#endif
#define ifreq_size(pifreq) ((pifreq)->ifr_addr.sa_len + sizeof((pifreq)->ifr_name))

View File

@@ -81,8 +81,8 @@ typedef socklen_t osiSocklen_t;
#define SOCK_ENOTSOCK ENOTSOCK
#define SOCK_EBADF EBADF
#ifndef SD_BOTH
#define SD_BOTH 2
#ifndef SHUT_RDWR
# define SHUT_RDWR 2
#endif
#define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))

View File

@@ -80,7 +80,9 @@ typedef int osiSocklen_t;
/*
* For shutdown()
*/
#define SD_BOTH 2
#ifndef SHUT_RDWR
# define SHUT_RDWR 2
#endif
/*
* Ensure that we get the right network code in default/osdNetIntf.c.

View File

@@ -37,6 +37,10 @@ extern "C" {
typedef u_long FAR osiSockIoctl_t;
typedef int osiSocklen_t;
#ifndef SHUT_RDWR
# define SHUT_RDWR SD_BOTH
#endif
#define MAXHOSTNAMELEN 75
#define IPPORT_USERRESERVED 5000U

View File

@@ -71,8 +71,8 @@ typedef int osiSocklen_t;
#define SOCK_ENOTSOCK ENOTSOCK
#define SOCK_EBADF EBADF
#ifndef SD_BOTH
#define SD_BOTH 2
#ifndef SHUT_RDWR
# define SHUT_RDWR 2
#endif
#define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))

View File

@@ -75,8 +75,8 @@ typedef int osiSockIoctl_t;
#define SOCK_ENOTSOCK ENOTSOCK
#define SOCK_EBADF EBADF
#ifndef SD_BOTH
#define SD_BOTH 2
#ifndef SHUT_RDWR
# define SHUT_RDWR 2
#endif
#define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))

View File

@@ -45,7 +45,9 @@ typedef int SOCKET;
#define SOCKERRNO errno
#define SOCKERRSTR(ERRNO_IN) (strerror(ERRNO_IN))
#define socket_close(S) close(S)
#define SD_BOTH 2
#ifndef SHUT_RDWR
# define SHUT_RDWR 2
#endif
/*
* it is quite lame on WRS's part to assume that