Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Sockets : Read, writing, and managing sockets on clients and servers : Writing data on a socket
 
Writing data on a socket
You can write data on a connected TCP/IP socket at any time using the WRITE( ) method on the corresponding socket object (SELF:WRITE( ) within the corresponding READ-RESPONSE event procedure).
The is the syntax of the WRITE( ) method:

Syntax

WRITE(
memptr-expression
, position
, bytes-to-write
)
The WRITE( ) method transfers the number of bytes specified by the INTEGER expression, bytes-to-write, from the specified MEMPTR variable, memptr-expression, to the socket starting from the byte position within the MEMPTR region specified by the INTEGER expression, position.
You can verify the number of bytes actually written by the WRITE( ) method. The number of bytes written by the last WRITE( ) method invoked on a socket object is equal to the value of the BYTES-WRITTEN attribute invoked on the same socket object.