iTP Active Transaction Pages (iTP ATP) Programmer's Guide
ATP Objects, Properties, and Methods
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide—522292-002
4-49
atp.socket Object
Methods
read([readcount])
This method reads readcount bytes from the socket and returns data in a string.
The method returns a value of null (a JavaScript reserved word) to indicate that
there is no more data. Thus, this method is usually invoked at least twice. For
example:
var str;
for (str=s.read(); str != null; str=s.read())
atp.print (str);
readcount
This parameter specifies the number of bytes to read. The default value is
15000; the maximum value is 15000.
write(string)
This method writes a string to the socket.
string
This parameter specifies the string to be written.
close()
This method closes the socket. If you do not call this method explicitly, ATP closes
the socket automatically at the end of the script.
setSoTimeout(timeout)
This method sets the timeout for subsequent socket methods.
timeout
This parameter specifies the timeout interval in hundredths of a second.
setSoKeepAlive()
This method enables TCP/IP keep-alive messages to ensure that a socket connection
does not time out.
setTcpNoDelay()
This method minimizes buffering of outbound (write) data within TCP/IP. For more
information, see the description of the socket option in the TCP/IP and IPX/SPX
Programming Manual.