Kbase P123810: Files sent via sockets are not complete
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/3/2007 |
|
Status: Unverified
SYMPTOM(s):
Using sockets to transfer files between systems
Socket client sends file to socket server
Socket server does not receive the whole file
Operating system running the client differs from the operating system running the server
Limited number of bytes received by the server
For example, IBM AIX socket server receives 2920 bytes from a client on another operating system
Checking GET-BYTES-AVAILABLE() does not make a difference
CAUSE:
Internal procedure handling READ-RESPONSE events (defined by SET-READ-RESPONSE-PROCEDURE) contains DISCONNECT() and DELETE OBJECT statements. The READ-RESPONSE procedure is called multiple times per connection, once for each packet sent across the network. By disconnecting within the READ-RESPONSE procedure, remaining data is lost.
FIX:
Check whether the client is still connected before disconnecting in the READ-RESPONSE procedure.
IF NOT SELF:CONNECTED() THEN DO:
SELF:DISCONNECT().
DELETE OBJECT SELF.
END.