gmlMessageTransportTCP Class Reference

Inherits from

Detailed Description

Exchange messages with one or several peers on the network, using a TCP connection.

For the exact meaning of "peer", "connection", etc., refer to the BIP protocol specification.

Exactly one Tcl socket channel is bound to a peer.

Additional configurable options:

-port integer
The TCP port on which the object listens. Can only be set during object creation. Defaults to an empty string, meaning that the object will not act as a TCP server. If the port is specified as 0, it will be automatically chosen.
-message-command cmd

Each time a message is going to be sent to a peer, cmd will be executed with one argument (the destination's peer ID), and it must return a message identifier.

The default is to return a random identifier.

Public Member Functions

constructor args

destructor

port

Return the server port used by this connection.

connect location {userdata {}}

Establish a connection with a peer at location. location has the usual form address:port where address is an IP address or a host name and port is a decimal port number.

disconnect {locations all}

Disconnect from peers, if connected. Else do nothing.

send mid location data

Send data to the location

isLocal location

return true iff location is on this machine