Version 1, last updated by Eric Maupin at September 02, 2009 16:26 UTC

Connecting

Gablarski uses TCP to pass most message types around (all "command" messages, like changing channels, logging in, muting a user, etc.) UDP is used to pass all media packets.

The client should connect to the server with the specified port with a TCP connection. The UDP handler should bind to the same local end point as TCP and immediately send 0x18, 0x18 to the server as a dummy packet for NAT punch through. The server will send back a network id (UInt32) over the TCP connection, you'll use this later for sending UDP messages.

Psuedocode:

tcp.connect (port)
udp.bind (tcp.localEndPoint)
udp.send ( [ 0x18, 0x18 ], server)
nid = tcp.readInt32()