![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | 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"); } |
|||
| Google The UNIX and Linux Forums |
| Forum Sponsor | ||
|
|