![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|