version 1.14, 2007/07/29 17:54:47
|
version 1.15, 2008/10/17 11:07:39
|
|
|
#if defined PEGASUS_OS_TYPE_WINDOWS | #if defined PEGASUS_OS_TYPE_WINDOWS |
# include <winsock2.h> | # include <winsock2.h> |
#else | #else |
# if defined PEGASUS_PLATFORM_ZOS_ZSERIES_IBM |
# if defined PEGASUS_OS_ZOS |
# include <arpa/inet.h> | # include <arpa/inet.h> |
#else | #else |
# include <error.h> | # include <error.h> |
|
|
struct hostent *hptr; | struct hostent *hptr; |
int herr=0,rc=0; | int herr=0,rc=0; |
| |
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM |
#ifdef PEGASUS_OS_ZOS |
extern int h_errno; | extern int h_errno; |
#endif | #endif |
| |
|
|
#endif | #endif |
| |
error_at_line (0, 0, __FILE__, __LINE__, | error_at_line (0, 0, __FILE__, __LINE__, |
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM |
#ifdef PEGASUS_OS_ZOS |
strerror (h_errno)); | strerror (h_errno)); |
#elif defined PEGASUS_OS_TYPE_WINDOWS | #elif defined PEGASUS_OS_TYPE_WINDOWS |
(char *)lpMsgBuf); | (char *)lpMsgBuf); |
|
|
struct hostent hbuf; | struct hostent hbuf; |
char tempbuf[8192]; | char tempbuf[8192]; |
// masking unability to transform an ip-address via gethostbyname() | // masking unability to transform an ip-address via gethostbyname() |
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM |
#ifdef PEGASUS_OS_ZOS |
extern int h_errno; | extern int h_errno; |
in_addr_t broker_ip_address; | in_addr_t broker_ip_address; |
broker_ip_address = inet_addr(address); | broker_ip_address = inet_addr(address); |
|
|
return -1; | return -1; |
} | } |
// masking end of if case for differing between ip-address and host | // masking end of if case for differing between ip-address and host |
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM |
#ifdef PEGASUS_OS_ZOS |
} | } |
#endif | #endif |
| |
|
|
if (( sockfd = socket ( | if (( sockfd = socket ( |
PF_INET, | PF_INET, |
SOCK_STREAM, | SOCK_STREAM, |
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM |
#ifdef PEGASUS_OS_ZOS |
0 ) ) == -1) | 0 ) ) == -1) |
#else | #else |
IPPROTO_TCP ) ) == PEGASUS_CMPIR_INVALID_SOCKET) | IPPROTO_TCP ) ) == PEGASUS_CMPIR_INVALID_SOCKET) |
|
|
sin.sin_port = htons ( port ); | sin.sin_port = htons ( port ); |
| |
if (bind ( listen_socket, (struct sockaddr *) &sin, sin_len ) || | if (bind ( listen_socket, (struct sockaddr *) &sin, sin_len ) || |
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM |
#ifdef PEGASUS_OS_ZOS |
listen ( listen_socket, 15 )) | listen ( listen_socket, 15 )) |
{ | { |
#else | #else |