Kbase P81307: Socket handle parameter passed to the connect procedure of the server becomes invalid after +/- 1024
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  1/27/2009 |
|
Status: Verified
SYMPTOM(s):
Socket handle parameter passed to the connect procedure of the server becomes invalid after +/- 1024 socket connections
Errors 3135 and 3140 after +/- 1024 socket connections
Invalid widget-handle. Not initialized or points to a deleted widget. (3135)
Cannot access the <attribute name> attribute because the widget does not exist. (3140)
Code based on samples supplied in the Progress External Program Interfaces manual
Socket is connected and disconnected +/- 1024 times
Socket object is disconnected and deleted in the 4GL socket client code
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.x
All Supported Operating Systems
CAUSE:
The operating system runs out of file descriptors and is unable to create a new socket connection. Thus, the parameter being passed to the connection procedure on the server is the unknown value, not a valid handle to a socket. This happens because the server never deletes any of the sockets - the connection procedure should end with a disconnect and delete of the socket.
FIX:
The connection procedure should end with a disconnect and delete of the socket otherwise the server will never delete any of the sockets:
/* Sample from Progress External Program Interfaces manual */
PROCEDURE connProc.
/* Connection procedure for server socket */
DEFINE INPUT PARAMETER hSocket AS HANDLE. /*Socket implicitly created*/
MESSAGE "We are in CONNECT event procedure, connProc".
hSocket:WRITE (mBuffer,1,LENGTH(greeting)).
MESSAGE hSocket:BYTES-WRITTEN "bytes written".
hsocket:DISCONNECT().
DELETE OBJECT hsocket.
END.