use posix sockets
This commit is contained in:
@@ -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) );
|
||||
|
||||
@@ -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) );
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user