Explanation of symbols used
Words in italics indicate an instance of a class. The word corresponds to the class name, except where
more than one instance is represented in the same statement. In that case a number (2, 3, etc.) is appended
to the class name.
Words in normal typeface are to be taken literally (required punctuation, class name in a static reference,
method name, etc.)
The symbol => is used to separate an expression (on the left) from its return value (on the right).
An ellipsis (...) indicates that the previous argument may be repeated any number of times. The
description will indicate whether one instance is required.
Member reference
constructors
socket = new Socket()
socket = new Socket(i)
Creates a new socket. If i is passed, it must be one of the two values
SS_SOCK_STREAM or SS_SOCK_DGRAM defined in DBLDIR:synsock.def. If not specified, SS_SOCK_STREAM
is assumed.
method Accept
socket.Accept() => socket2
This method waits for connection requests on
socket and returns
socket2 on which to
carry the conversation. You must first establish
socket as a socket for listening before
calling this method by calling the
Listen method. Typically, a server will
call Listen once, and then Accept in a loop. If an error occurs, a
SocketException will be thrown.
method Close
socket.Close() => boolean
Closes a socket, if it is open, returning true if successful. If an error occurs, no exception is thrown. This method is called
automatically in the destructor if the socket is open, but you may wish to call it explicitly to
control timing.
method Connect
socket.Connect(i, i2) => boolean
Connect to the host at IP address
i on port
i2. To translate a
host name or a dotted form of the address to an integer as required for
i, see
the
GetHostByName or
IPAddress
methods, respectively. If an error occurs, a
SocketException will be thrown.
property Connected
socket.Connected => boolean
This read-only property returns true if the socket is connected, otherwise false.
static method GetHostByName
Socket.GetHostByName(a) => i
This static method returns an IP address for the host named in
a. If an error occurs, a
SocketException will be thrown.
static method IPAddress
Socket.IPAddress(a) => i
This static method returns an IP address for the dotted form of the address in
a. If an error occurs, a
SocketException will be thrown.
method Listen
socket.Listen(i) => boolean
This method establishes a port
i on which to listen for connections as a server. If successful, it returns
true. If an error occurs, a
SocketException will be thrown.
override method Receive
socket.Receive(a) => i
This method receives data from an open socket and returns it in
the parameter a, which must be writable.
The method returns the number of characters returned in a.
override method Send
socket.Send(a) => boolean
This method sends the characters in
a to the open socket.
It returns true if successful. If an error occurs, a
SocketException will be thrown.
class SocketException extends Synergex.SynergyDE.SynException
This class of exception is thrown whenever an unexpected socket error occurs. Its public member SocketStatus is an
integer that contains the socket status returned. Its inherited Message member is set to "Socket error: n", where n is the socket status code.