The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem with socket reading swap007 UNIX for Advanced & Expert Users 2 05-20-2008 10:08 PM
HTTP Keep-Alive socket problem imdupeng High Level Programming 0 03-29-2008 05:11 PM
socket communication but not writing madfox High Level Programming 2 12-04-2007 11:44 AM
Problem Connecting to Socket Stevhp High Level Programming 6 04-30-2007 04:27 PM
Socket Problem Agent007 High Level Programming 3 04-03-2004 05:15 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-24-2005
Registered User
 

Join Date: Feb 2005
Posts: 1
Stumble this Post!
Thumbs up Problem in HP-Unix while writing into socket

Our system is having a server and multiple clients. We are monitoring the client FDs using select() system call in HP-UX.

After establishing connection-using socket with the remote client, before start sending the data we are checking the status of socket using select( ) call. For first 16 clients the select() call is unblocked and FD_ISSET( ) returns success. But from the 17th client onwards, the select() is unblocked and FD_ISSET( ) is NOT RETURNING SUCCESS(it is returning negative value), both in HP-UX 11 and 11i. But the same logic works fine till 1024 clients in Solaris, AIX, Linux.
Source code is mentioned below,

Please tell how to rectify this problem.

fd_set Writefds;
struct timeval Timeout;
int RetCode;
int RetValue;
int SockDesc;
struct sockaddr_in client;
char BulkData[5000] = "Acknowledgement";
int retVal;

int clientlen = sizeof( struct sockaddr_in);

client.sin_family = AF_INET;
client.sin_addr.s_addr = INADDR_ANY;
client.sin_port = htons(SERVER_PORT);
SockDesc = socket(AF_INET, SOCK_STREAM, 0);
connect(SockDesc, &client,(socklen_t) clientlen);

Timeout.tv_sec = 0;
Timeout.tv_usec = 0;
FD_ZERO(&Writefds);
FD_SET(SockDesc, &Writefds);
RetCode = select(0, NULL, &Writefds, NULL, &Timeout);
if (RetCode > 0)
{
retVal = FD_ISSET(SockDesc, &Writefds);
if ( retVal > 0)
{
send(SockDesc, szBulkData,(size_t) sizeof(szBulkData), 0);
}
else
{
printf("FD_ISSET is failed:%d\n", retVal);
}
}
else if (RetCode == -1)
{
printf("select return Error:%d\n", errno);
}
else if (RetCode == 0)
{
printf("select return 0 [timeout occured].\n");
}
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0