IPPort Component

The IPPort control facilitates TCP/IP communications by providing an easy interface to Winsock functions. It allows a client application to communicate with a server using stream sockets.

(NOTE: The following is a very short description. For more information, please consult the help files that come with the respective package.)


Our main goal in designing IPPort was ease of use. The control has a minimum of properties and five events: Connected, DataIn, Disconnected, ReadyToSend, and Error. The events are relatively self-explanatory.

The connection is attempted by setting the Connected property to True, and then waiting for the Connected event. The destination is defined by setting RemoteHost and RemotePort. Data is sent by assigning the data string to the DataToSend property.

To disconnect, you just set the Connected property to False. The Linger property controls how the connection is terminated.

The operation of the control is almost completely asynchronous. All the calls except the ones that deal with domain name resolution, operate through Windows messages (no blocking calls). The gain in performance is considerable when compared to using blocking calls.

This control requires a Winsock 1.1 compliant TCP/IP stack. This means that the Winsock stack installed in the system must have a version of at least 1.1. In particular, Windows 95, 98, and NT machines with Winsock 2.0 are fully supported.


   PROPERTIES

AcceptData. Enables or disables data reception (the DataIn event).

BytesSent. The number of bytes actually sent after an assignment to DataToSend.

Connected. Triggers a connection or disconnection. Action property.

DataToSend. A string of data to be sent to the remote host.

EOL. Used to break the incoming data stream into chunks separated by EOL.

InBufferSize. The size in bytes of the incoming queue of the socket.

KeepAlive. When True, KEEPALIVE packets are enabled (for long connections).

Linger. When set to True, connections are terminated gracefully.

LocalHost. The name of the local host. When connected, the IP address of the interface through which the connection was made.

LocalPort. The TCP port in the local host where IPPort binds.

MaxLineLength. The maximum amount of data to accumulate when no EOL is found.

OutBufferSize. The size in bytes of the outgoing queue of the socket.

RemoteHost. The address of the remote host. Domain names are resolved to IP addresses.

RemotePort. The TCP port in the remote host.

SocketHandle. The handle of the main socket used by the control.

WinsockInfo. Identifying information about the loaded Winsock stack.

WinsockLoaded. Loads and unloads Winsock on demand.

WinsockMaxDatagramSize. Size in bytes of the largest UDP datagram that can be sent or received.

WinsockMaxSockets. Maximum number of sockets available to a single process.

WinsockPath. The path to the Winsock DLL used.

WinsockStatus. The status of the Winsock stack.

   EVENTS

Connected. Fired immediately after a connection completes (or fails).

DataIn. Fired when data (complete lines) comes in.

Disconnected. Fired when a connection is closed.

Error. Information about errors during data delivery.

ReadyToSend. Fired when IPPort is ready to send data.


© 1999 devSoft Inc. - All Rights Reserved.
devSoft Inc.,  P.O.Box 13821 , Research Triangle Park, NC 27709 , USA,