psock.dll
Classes:
#module root.communication.tcpip
The HostEntry class is populated by the GetHostByName and
GetHostByAddress methods
Name - official name of host
Aliases - alias list
Addrtype - host address type
AddrList - list of addresses
#module root.communication.tcpip
The ServiceEntry class is populated by the GetServByName,
GetServByPort and GetPeerName methods
Name - official name of service
Aliases - alias list
Port - port #
Proto - protocol to use
#module root.communication.tcpip
The SocketAddress class is designed for passing the address to the
methods of TCPDatagram and TCPStream classes which work with sockets
Port - port
Address - address as integer number
Methods:
param Port;
Creates an address for receiving input diagram from the arbitrary
source through the port specified via the Port parameter.
param Address, Port;
Creates an address in order to work with the following pair (Address, Port)
Creates an address for receiving arbitrary input diagram.
#module root.communication.tcpip
The TCPDatagram class is designed for UDP protocol work.
Datagrams are transmitted without establishing paired association
between the transmitter and receiver.
Methods:
This method returns the maximal datagram size which
is valid in the current system.
This method returns the HostEntry object which is populated
with information about the computer from which the last data
block was received by the Receive function.
The event handler that notifies about data
occurrence in the input buffer.
The event handler that notifies about free space
occurrence in the output buffer.
param Len;
This method reads bytes (their number is specified via the Len
parameter) from the input buffer. If the number of bytes in the
buffer is less than the Len parameter then only actually received
bytes are read.
Returns the object of the String class.
The OnRead event handler is called if data appears in the input buffer.
param Address, Data.
This method sends data specified via the Data parameter to the address
specified via the Address parameter.
Data bringing is not guaranteed.
This method returns the number of bytes that were actually accepted
for transmission.
The size of the maximal transmitted block can be determined by
the GetMaxDatagram() method.
The OnWrite event handler is called if free space appears in the
output buffer.
param Address, Data, Offset, Len;
This method sends bytes (their number is specified via the Len
parameter) parameter with the offset specified via the Offset
parameter from data specified via the Data parameter to the
address specified via the Address parameter.
Data bringing is not guaranteed.
This method returns the number of bytes that were actually
accepted for transmission.
The size of the maximal transmitted block can be determined
by the GetMaxDatagram()method.
The OnWrite event handler is called if free space appears in
the output buffer.
param PortNumber;
Creates a TCPDatagram for the port specified via the parameter.
Constructor
Destructor
#module root.communication.tcpip
The TCPStream class performs TCP protocol stream connection.
In the descendant class it is necessary to override the event
handlers - i.e. On... methods.
In order to create a client it is necessary to create an
object and call the Connect method.
In order to create a server it is necessary to create an
object and call the InitServer method. The OnAccept event handler
is called when connection request is received.
If the server determines to accept the connection request then it
has to call the Accept method. The Accept method returns an object
of the TCPStream class which is connected to the client and the
server object keeps listening to the network.
Methods:
This method accepts the input call.
It is invoked only by the server socket on receiving the "connection
request" event (OnAccept handler).
This method returns the object of the same class as the class which
called this method. This object is linked to the client that request
the connection. The further interaction with the client is performed
via the object which was returned by the Accept method. The server
object keeps waiting for the input connection requests.
param Address;
This method is called by the client-object in order
to establish connection with server.
Returns the populated object of the HostEntry class
when in the in-sync state.
Returns the task identifier that can be used when calling
the CancelAsyncRequest method when in the out-of-sync state.
The OnConnect event handler is called upon the completion of the task.
This method returns the HostEntry object which is populated with
information about the computer to which this object is linked.
It can be used by the object returned by the Accept method in
order to ascertain the name of the client which requested the
connection.
param SocketAddress;
Initiates server on the connection request receive from the port and
address determined by the object which in turn is specified via the
SocketAddress parameter.
If client's address is not determined then the TCPIP_INADDR_ANY
constant can be used as the address.
param SocketAddress, NumberOfPendingCalls;
Initiates server on the connection request receive from the port and
address determined by the object which in turn is specified via the
SocketAddress parameter.
If client's address is not determined then the TCPIP_INADDR_ANY constant
can be used as the address.
The NumberOfPendingCalls parameter must be within 1 to 5. It specifies
the number of input requests which are enqueued for connection
acceptance.
The event handler that notifies about the connection request from a client.
This method calls the Accept() method for the TCPStream class.
The obtained (new) object of the TCPStream class is added to the list
in the variable of the Servers class.
The event handler that notifies about the connection closing-down.
The event handler that notifies that server received the connection.
The event handler that notifies about the out of order data receiving.
The event handler that notifies when data appears in the input buffer.
The event handler that notifies when free space appears in the output buffer.
param Len;
This method reads bytes (their number is specified via the Len parameter)
from the input buffer.
If the number of bytes in the buffer is less than the Len parameter then
only actually received bytes are read.
Returns the object of the String class.
When in the out-of-sync state the OnRead event handler is called if
data appears in the input buffer.
This method reads the contents of the input buffer.
Returns the object of the String class.
This method reads bytes (their number is specified via the Len parameter)
from data transmitted out of order.
If the number of bytes in the buffer is less than the Len parameter then
only actually received bytes are read.
Returns the object of the String class.
When in the out-of-sync state the OnOutOfBound event handler is called
if data appears in the input buffer.
Recreates socket. Closes the connection.
param Data;
This method sends data specified via the Data parameter out of order.
If there are no enough space in the output buffer then the number
of bytes determined by free space is accepted for transmission.
This method returns the number of bytes that were actually accepted
for transmission.
When in the out-of-sync state the OnWrite event handler is called if
free space appears in the output buffer.
param Data, Offset, Len;
This method sends bytes (their number is specified via the Len parameter)
with the offset specified via the Offset parameter from
data specified via the Data parameter out of order.
If there are no enough space in the output buffer then the number
of bytes determined by free space is accepted for transmission.
This method returns the number of bytes that were actually accepted
for transmission.
When in the out-of-sync state the OnWrite event handler is called if
free space appears in the output buffer.
Constructor.
param Data;
This method sends data specified via the Data parameter
to the stream connected with self.
If there are no enough space in the output buffer then the number
of bytes determined by free space is accepted for transmission.
This method returns the number of bytes that were actually accepted
for transmission.
When in the out-of-sync state the OnWrite event handler is called if
free space appears in the output buffer.
param Data, Offset, Len;
This method sends bytes (their number is specified via the Len parameter)
with the offset specified via the Offset parameter from
data specified via the Data parameter to the stream connected with
self.
If there are no enough space in the output buffer then the number
of bytes determined by free space is accepted for transmission.
This method returns the number of bytes that were actually accepted
for transmission.
When in the out-of-sync state the OnWrite event handler is called if
free space appears in the output buffer.
Destructor.
#module root.communication.tcpip
The TCP_IP class allows to get information about network addresses
and services. You should set the Sync field to TRUE in order to work
in the in-sync state, by default the out-of-sync state is set.
When in the out-of-sync state the end of ordered tasks processing
results in calling the event handlers - i.e. On... methods. By default,
handlers print out the received result.
In your application you should derive a descendant from the TCP_IP
class and override event handler methods.
Methods:
param Enable;
Enables broadcast transmission (for datagrams only).
param TaskID;
Breaks the out-of-sync task execution.
The task identifier is returned by methods of the GetXByY type in
the out-of-sync state.
param Enable;
Disables package routing.
param Enable, TimeOut;
If Linger is enabled then the presence of non-transferred data in
the output buffer is checked when destroying an object.
If data is present then system tries to transfer data during the time
interval specified via the TimeOut parameter (in seconds) before
closing the socket.
If Linger is illegal then the socket is closed immediately and all
data in the output buffer is cleared.
param ErrorCode;
Returns the description of the error code.
param Address;
Finds information about a computer according to its network address.
Returns the populated object of the HostEntry class when in the in-
sync state.
Returns the task identifier that can be used when calling the
CancelAsyncRequest method when in the out-of-sync state.
The OnGetHostBy event handler is called upon the completion of the task.
param Name;
Finds information about a computer according to its network name.
Returns the populated object of the HostEntry class when in the in-
sync state.
Returns the task identifier that can be used when calling the
CancelAsyncRequest method when in the out-of-sync state.
The OnGetHostBy event handler is called upon the completion of the task.
Returns the network name of the local machine.
Returns the last error code.
Returns the maximum number of sockets which can be opened in the
system simultaneously.
param Name;
Finds information about a service according to its name.
Returns the populated object of the ServiceEntry class when in the in-
sync state.
Returns the task identifier that can be used when calling the
CancelAsyncRequest method when in the out-of-sync state.
The OnGetServiceBy event handler is called upon the completion of the task.
param Name, Protocol;
Finds information about a service according to its name and protocol
name ("TCP" or "UDP").
Returns the populated object of the ServiceEntry class when in the in-
sync state.
Returns the task identifier that can be used when calling the
CancelAsyncRequest method when in the out-of-sync state.
The OnGetServiceBy event handler is called upon the completion of the task.
Finds information about a service according to port number.
Returns the populated object of the ServiceEntry class when in the in-
sync state.
Returns the task identifier that can be used when calling the
CancelAsyncRequest method when in the out-of-sync state.
The OnGetServiceBy event handler is called upon the completion of the task.
param Port, Protocol;
Finds information about a service according to port number and
protocol name ("TCP" or "UDP").
Returns the populated object of the ServiceEntry class when in the in-
sync state.
Returns the task identifier that can be used when calling the
CancelAsyncRequest method when in the out-of-sync state.
The OnGetServiceBy event handler is called upon the completion of the task.
Returns the SocketAddress class object which is populated with socket data.
param Value;
Converts the 32-bit integer number to the network format from the
local machine format.
param Value;
Converts the 16-bit integer number to the network format from the
local machine format.
param Addr;
Converts integer number which represents the network address to string
that contains the network address in the following format
127.000.000.001
param Value;
Converts the 32-bit integer number to the local machine format from
the network format.
param Value;
Converts the 16-bit integer number to the local machine format from
the network format.
param Enable;
Disables transmission delay before full package fill according to
Nagle algorithm.
param Enable;
Moves "out of turn" parcels transmission to the general data flow.
param ErrorCode;
The method-handler of the "error when performing the out-of-sync task" event.
The ERR_PSC_TCPIP_ERROR error is raised by default.
param HostEntry;
The method-handler of the "host information request" event.
Receives the populated object of the HostEntry class as the parameter.
param ServiceEntry;
The method-handler of the "service information request" event.
Receives the populated object of the ServiceEntry class as the parameter.
param Enable;
Enables the connection of the second server socket to the occupied port.
param BufferSize;
Sets the input buffer size.
param BufferSize;
Sets the output buffer size.
param Name;
Converts string that contains the network address in the following format
127.000.000.001
to integer number.
Constructor.
Destructor.
- Accept, method of class TCPStream
- BroadCast, method of class TCP_IP
- CancelAsyncRequest, method of class TCP_IP
- Connect, method of class TCPStream
- DontRoute, method of class TCP_IP
- EnableLinger, method of class TCP_IP
- GetErrorString, method of class TCP_IP
- GetHostByAddress, method of class TCP_IP
- GetHostByName, method of class TCP_IP
- GetHostName, method of class TCP_IP
- GetLastError, method of class TCP_IP
- GetMaxDatagram, method of class TCPDatagram
- GetMaxSockets, method of class TCP_IP
- GetPeerName, method of class TCPDatagram
- GetPeerName, method of class TCPStream
- GetServByName, method of class TCP_IP
- GetServByPort, method of class TCP_IP
- GetSocketName, method of class TCP_IP
- HostEntry, class
- HostToNetInt, method of class TCP_IP
- HostToNetShortInt, method of class TCP_IP
- InitServer, method of class TCPStream
- IntAddrToStr, method of class TCP_IP
- NetToHostInt, method of class TCP_IP
- NetToHostShortInt, method of class TCP_IP
- NoDelay, method of class TCP_IP
- OnAccept, method of class TCPStream
- OnAsyncCallError, method of class TCP_IP
- OnClose, method of class TCPStream
- OnConnect, method of class TCPStream
- OnGetHostBy, method of class TCP_IP
- OnGetServiceBy, method of class TCP_IP
- OnOutOfBound, method of class TCPStream
- OnRead, method of class TCPStream
- OnReceive, method of class TCPDatagram
- OnSend, method of class TCPDatagram
- OnWrite, method of class TCPStream
- OOBinLine, method of class TCP_IP
- Read, method of class TCPStream
- Receive, method of class TCPDatagram
- ReceiveOOB, method of class TCPStream
- Reset, method of class TCPStream
- ReuseAddress, method of class TCP_IP
- Send, method of class TCPDatagram
- SendOutOfBound, method of class TCPStream
- ServiceEntry, class
- SetReciveBufferSize, method of class TCP_IP
- SetSendBufferSize, method of class TCP_IP
- SocketAddress, class
- SocketAddress, method of class SocketAddress
- StrAddrToInt, method of class TCP_IP
- TCP_IP, class
- TCP_IP, method of class TCP_IP
- TCPDatagram, class
- TCPDatagram, method of class TCPDatagram
- TCPStream, class
- TCPStream, method of class TCPStream
- Write, method of class TCPStream
- ~TCP_IP, method of class TCP_IP
- ~TCPDatagram, method of class TCPDatagram
- ~TCPStream, method of class TCPStream