wwsocket::SocketSend

High level method that connects to a socket, sends data and receives a result then disconnects from the socket. Great for various XML services that follow a simple transaction model with a 'hit'.

o.socketsend(lcInput,lcServer,lnServerPort,lnTimeout,@lcError)

Return Value

result string

Parameters

lcInput
The string to send to the TCP/IP server.

lcServer
IP Address or domain name of the server to access.

lnServerPort
Port on the server to use.

lnTimeout
Timeout of the request in seconds.

@lcError
Gets set with an error message if an error occurs. Pass in by reference

Remarks

You don't need to call Connect() or Disconnect() when using this method.

Example

loIP = CREATEOBJECT( "wwSocket")

lcRequest = "helo rstrahl"
lcError = ""

*** Returns mail server hello message
? loIP.SocketSend(lcRequest,"mail.yourserver.net",25,10,@lcError)

See also:

Class wwsocket

© West Wind Technologies, 1996-2024 • Updated: 10/03/01
Comment or report problem with topic