The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > 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-21-2008 01:08 AM
HTTP Keep-Alive socket problem imdupeng High Level Programming 0 03-29-2008 09:11 PM
socket communication but not writing madfox High Level Programming 2 12-04-2007 03:44 PM
Problem Connecting to Socket Stevhp High Level Programming 6 04-30-2007 07:27 PM
Socket Problem Agent007 High Level Programming 3 04-03-2004 08:15 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-25-2005
AshokG AshokG is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 1
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");
}
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0