| Open Object Rexx™: RxSock TCP/IP Socket Functions Reference | ||
|---|---|---|
| Prev | Chapter 6. Socket Class Reference | Next |
>>--getHostByAddr(ipaddr)--------------------------------------><
This is a class method. It returns an instance of the HostInfo class.
>>--getHostByName(hostname)------------------------------------><
This is a class method. It returns an instance of the HostInfo class.
>>--getHostId()------------------------------------------------><
This is a class method. It returns the dotted decimal host id of the local machine.
>>--accept()---------------------------------------------------><
This method returns a new socket class instance that is connected to a remote host that has requested a connection from a server socket.
>>--bind(address)----------------------------------------------><
This method binds a socket to a particular local ip address specified by an instance of the InetAddress class contained in the address argument.
>>--close()----------------------------------------------------><
This method closes this socket instance.
>>--connect(address)-------------------------------------------><
This method connect the socket to a remote address specified by an instance of the InetAddress class contained in the address argument.
>>--getOption(option)------------------------------------------><
This method returns the value of the options specified by the option argument.
The option argument must be one of the following:
| SO_BROADCAST |
| SO_DEBUG |
| SO_DONTROUTE |
| SO_ERROR |
| SO_KEEPALIVE |
| SO_LINGER |
| SO_OOBINLINE |
| SO_RCVBUF |
| SO_RCVLOWAT |
| SO_RCVTIMEO |
| SO_REUSEADDR |
| SO_SNDBUF |
| SO_SNDLOWAT |
| SO_SNDTIMEO |
| SO_TYPE |
| SO_USELOOPBACK |
>>--getPeerName()----------------------------------------------><
This method returns the peer name of the remote connection.
>>--getSockName()----------------------------------------------><
This method returns an instance of the InetAddress class than is the name information of the remote machine.
>>--new(--+------------------------------------------+--)------><
+--domain--+----------------------------+--+
+--, type--+--------------+--+
+--, protocol--+This method returns a new instance of the Socket.
If specified, this argument must be AF_INET.
If specified, this argument must be SOCK_STREAM, SOCK_DGRAM or SOCK_RAW. SOCK_STREAM is the default.
If specified, this argument must be 0, IPPROTO_UDP or IPPROTO_TCP. 0 is the default.
>>--ioctl(cmd, data)-------------------------------------------><
This method sends a special command to the socket. The cmd and the data are not checked for valid values.
>>--listen(backlog)--------------------------------------------><
This method turns the socket into a server listening socket. The backlog is the number of connection requests the socket should cache.
>>--recv(length)-----------------------------------------------><
This method recieves data on a socket connection. The length is the maximum number of bytes the socket should receive. This method returns the data received, which could be less than the maximum length specified.
>>--recv(length, address)--------------------------------------><
This method recieves data on a socket connection from the specified address. The address must be an instance of the InetAddress class. The length is the maximum number of bytes the socket should receive. This method returns the data received, which could be less than the maximum length specified.
>>--select(reads, writes, excepts, timeout)--------------------><
This method monitors activity on a set of sockets. It returns the number of sockets ready for activity. Upon return the input argument arrays will be reset to only the sockets that are ready.
An array of socket instances to monitor for read activity.
An array of socket instances to monitor for write activity.
An array of socket instances to monitor for exception activity.
The timeout in seconds. This must be a whole number (no fractions allowed).
>>--send(data)-------------------------------------------------><
This method sends the data on the socket. It returns the number of bytes sent, which could be less than the length of data.
>>--setOption(name, value)-------------------------------------><
This method sets the option given by name with the data in value. See the method getOption for the list of valid names.
>>--string()---------------------------------------------------><
This method returns the string representing the socket.