Socket() “too many files open” error – but no files are open
I am writing an RPG Sockets program and when I call the "C" socket() function, I am receiving an "EMFILE 3452 Too many open files for this process" error.  However, there are no other files open in this program. The code and prototypes are exactly the same as an existing "C" client that is working. Its fairly straightforward and seems like it should be working. Any ideas on what is happening would be appreciated. OS=V5R1 0068.00 d Socket          pr            10i 0 ExtProc('socket') 0069.00 d  prSockFam                    10i 0 Value 0070.00 d  prAddrType                   10i 0 Value 0071.00 d  prProtocol                   10i 0 Value      0187.00 d AF_INET         c                   Const(2) 0188.00 d SOCK_STREAM     c                   Const(1) 0189.00 d PROTOCOL        c                   Const(0) /FREE 0390.00     socket1 = Socket(AF_INET:SOCK_STREAM:PROTOCOL);

Software/Hardware used:
AS400 Sockets
ASKED: April 5, 2012  8:52 PM
UPDATED: April 6, 2012  12:17 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

…when I call the “C” socket() function, I am receiving…

How do you know that’s what you’re receiving? That is, please show the code that determines that an error exists and that the errno is 3452.

Also, what happens before Socket() that might set errno?

Tom

 110,215 pts.