Operating System - OpenVMS
1752564 Members
5544 Online
108788 Solutions
New Discussion юеВ

Re: select() returns -1, errno:16 EBUSY, socket error: 10102

 
Gary Henry_1
Occasional Visitor

select() returns -1, errno:16 EBUSY, socket error: 10102

I have 30 client applications that connect to a server using sockets. When the 31st client application tries to connect the server does a select on the socket and select returns -1 where the previous 30 clients did not. The errno and socket error returned are:

errno:16 EBUSY
socket error: 10102

I checked the socket using fstat and it says that it is a valid socket so there must be some other problem. Anyone have any ideas of what I could look for?
4 REPLIES 4
marsh_1
Honored Contributor

Re: select() returns -1, errno:16 EBUSY, socket error: 10102

hi,

have you got any details on the operating system and tcpip stack involved here ?

Hoff
Honored Contributor

Re: select() returns -1, errno:16 EBUSY, socket error: 10102

You'll need sufficient I/O channels in AUTHORIZE and sufficient channels in CHANNELCNT and FD_SETSIZE can get involved here, but the culprit here is probably the value specified for the nfds argument; that's the size of the bit array of the channels that are involved in the select call.

And for weirdnesses around the value of 31, also watch out for signed versus unsigned handling.

What that "socket error" here might be isn't certain; you'll want to look at the code and see what value (and what radix) that is returning.

If that's not it, please post more details and/or some code and/or a reproducer. And as requested, platform and version details, too.
Gary Henry_1
Occasional Visitor

Re: select() returns -1, errno:16 EBUSY, socket error: 10102

I am using OpenVMS 8.2 and 8.3 on Itanium processors. The TCP/IP stack is whatever comes with OpenVMS for 8.2 and 8.3. Here are my AUTHORIZE settings:

Maxjobs: 0 Fillm: 300 Bytlm: 1000000
Maxacctjobs: 0 Shrfillm: 0 Pbytlm: 0
Maxdetach: 0 BIOlm: 10000 JTquota: 4096
Prclm: 75 DIOlm: 10000 WSdef: 100000
Prio: 4 ASTlm: 400 WSquo: 100000
Queprio: 0 TQElm: 400 WSextent: 100000
CPU: (none) Enqlm: 4000 Pgflquo: 1000000

Are the I/O channels the BIOlm and DIOlm? What are sufficient values?

How do I check to see what my CHANNELCNT is set to and how can I increase it?

My FD_SETSIZE is currently set to 1024 and my nfds setting is always set to one more than the socket number that is trying to be opened. For example, if I am doing a select on socket 34 my nfds is set to 35.

I don't have a program I can provide to reproduce or code sample other that the following select statement:

amt = (*AGS_selectFunc)( amt + 1, &readfds, &writefds, NULL, ptimeout );

Thanks for responding so quickly.

Hoff
Honored Contributor

Re: select() returns -1, errno:16 EBUSY, socket error: 10102

This message is a repost; ITRC blew up again, and does not appear to have accepted the previous attempt to post this.

--

The:

amt = (*AGS_selectFunc)( amt + 1, &readfds, &writefds, NULL, ptimeout );

is not nearly enough source code for a reasonable discussion.

It's not even certain that single source line actually invokes a select call. Well, not unless we assume where that "AGS_selectFunc" ends up at run-time... And what readfds and writefds point to, for that matter. Nor the value stored in amt at run-time.

Have you run this under the debugger, and taken a look at the code at run-time? (And I'd probably take a close look at that "AGS_selectFunc" pointer, too; at where that ends up.

CHANNELCNT is a system parameter, and visible via the SYSMAN utility PARAMS command. As with the above discussion, these quotas and the CHANNELCNT value are potential limits. Comparatively unlikely to be the trigger, too, as compared with bugs in the code. Examine the code first; that's the most likely trigger here. And only then look to see if you're at a limit beyond what's stored in amc, and in the bit arrays.