TCPHandler Object
    
 
Description

Manages forwarding of UDP packets through TCP stream.

Remarks

TCPHandler object helps you establish TCP connection with remote peer, even wodVPN internally uses UDP packets.

What it does it basically opens two local listening sockets  - UDP (for wodVPN), and TCP (for remote peer). When packet arrives on either of those, it relays it to another one. Having local UDP packet is neccessary for wodVPN. When you set up TCPHandler object, wodVPN will use this UDP on 127.0.0.1 interface just as all other endpoints received as result of Search method, and it will try to establish connection through it. Of course that is one side of TCPHandler. Once local ports are open (and TCPHandler set to Listen state), you can use it's Connect method to connect to remote peer if you know remote endpoint.

You can use TCPHandler to make connection through TCP Relay too. TCP Relay can be easily setup on some port on public computer, visible to both peers. When TCPHandler connects to TCP Relay, it presents itself, and searches for remote peer. When remote peer arrives to same relay, TCP Relay starts relaying TCP packets, which are then related to UDP packets via TCPHandler. Obviously, this is a bit slower connection than direct UDP->UDP.

You can establish connections in two basic modes - direct P2P, or through relay:

1. Direct P2P: wodVPN (UDP) -> TCPHandler (UDP) -> TCPHandler (TCP) <----> TCPHandler (TCP) -> TCPHandler (UDP) -> wodVPN (UDP)

2. Through relay: wodVPN (UDP) -> TCPHandler (UDP) -> TCPHandler (TCP) <--> TCP Relay <--> TCP Handler (TCP) -> TCPHandler (UDP) -> wodVPN (UDP).

Using TCPHandler you can establish connections through most firewalls, especially if you set TCP Relay on some server on port 443.

Members

Methods
Disconnect Disconnects from remote TCPHandler.
ConnectInitiates connection to remote TCPHandler (or TCP relay).
Listen Listens for incoming TCP connections.

Properties
LocalTCPPortRead-write property Holds local TCP port where TCPHandler listens.
LocalUDPPortRead-write property Holds local UDP port where TCPHandler listens.
RemoteTCPHostRead-write property Holds hostname of remote TCPHandler (or TCP relay).
RemoteTCPPortRead-write property Holds port of remote TCPHandler (or TCP relay).
StateRead-only property Returns current TCPHandler state.