Networking Classes Summary

The following pages provide detailed information on the properties and methods for the various classes that implement Ethernet networking communications.

The networking classes include:  a IPEndPoint Class for specifying IP and port addresses; a Socket Class that is the basis for most networking I/O operations and contains the basic send and receive methods; a TcpListener Class that is used for implementing TCP server applications; a TcpClient Class for implementing TCP client applications; and finally a UdpClient Class for implementing both the server and client side of UDP based communications.

The tables below summarize the properties and methods for each Class, which are described in greater detail in the following sections.

IPEndPoint Member Class
IPEndPoint Member Type Description

New IPEndPoint

Constructor Method

Creates an Endpoint and allows the IP Address and Port to be specified.

ipendpoint_obj.IPAddress    

Property

Sets or gets the IP Address of an Endpoint.

ipendpoint_obj.Port

Property

Sets or gets the Port of an Endpoint.

 

Socket Member Class
Socket Member Type Description

socket_obj.Available

Property    

Gets the number of data bytes currently available to receive from a Socket.

socket_obj.Blocking

Property

Sets or gets the blocking mode for a Socket. If True, the Socket blocks.  If False, it does not block.

socket_obj.Close

Method

Closes any connections associated with a Socket.

socket_obj.Connect

Method

Requests a TCP Client connection with a remote TCP Server.

socket_obj.KeepAlive

Property

Sets or gets the flag that controls whether a keep-alive message is automatically transmitted over the current TCP connection.

socket_obj.Receive

Method

Receives a datagram from an open TCP connection.

socket_obj.ReceiveFrom

Method

Receives a datagram from an open UDP connection.

socket_obj.ReceiveTimeout

Property

Sets or gets the receive timeout, in milliseconds, for a Socket.

socket_obj.RemoteEndPoint

Property

Gets information about the remote end point of a TCP connection.

socket_obj.Send

Method

Sends a datagram on an open TCP connection.

socket_obj.SendTimeout

Property

Sets or gets the send timeout, in milliseconds, for a Socket.

socket_obj.SendTo

Method

Sends a datagram to an open UDP connection.

 

TcpClient Member Class
TcpClient Member Type Description

New TcpClient

Constructor Method

Creates an Object for a TCP Client and optionally requests a connection.

tcpclient_obj.Client             

Method

Returns the embedded Socket for performing I/O.

tcpclient_obj.Close

Method

Closes a Client Socket and breaks any connection.

 

TcpListener Member Class
TcpListener Member Type Description

New TcpListener

Constructor Method

Creates an Object for a TCP Server to listen for connections.

tcplistener_obj.AcceptSocket

Method

Accepts a connection and returns a new Socket Object for use by the TCP Server.

tcplistener_obj.Close

Method

Stops listening and closes the listener Socket.

tcplistener_obj.Pending

Property

True if there is a pending connection and AcceptSocket will succeed. Otherwise False.

tcplistener_obj.Start

Method

Starts listening for connection requests.

tcplistener_obj.Stop

Method

Stops listening and closes the listener Socket. Same as Close method.

 

UdpClient Member Class
UdpClient Member Type Description

New UdpClient

Constructor Method

Creates an Object for I/O using UDP.

udpclient_obj.Client              

Method

Returns the embedded Socket for performing I/O.

udpclient_obj.Close

Method

Closes a Socket.