The two-socket system

Top  Previous  Next

This table shows the sequence of events that occurs when a client connects to the server and wishes to use two sockets (a 'main' socket for normal communication, and an 'immediate' socket for instant, well-defined replies).

 

Main socket

Immediate socket

Client

Server

Client

Server

(connects a socket on main port)


(socket not connected yet)



Info: WhiskerServer v1.0, ...

Info: You are client number XXX

ImmPort: 1234

Code: 1_41





(connects a socket on port 1234)





(no response)



Link 1_41





Success

The two sockets are now linked and operate as a functional pair.

 

The main port is usually port 3233 (the Whisker port number as registered with the Internet Assigned Numbers Authority, IANA). The server will always inform the client of the immediate port number, which is a currently unused socket, picked by the operating system.

 

The C++ client library (WhiskerClientLib) and the SDK Control perform these tasks automatically when you ask for a connection to the server.

 

This section explains the syntax of:

 

ImmPort
Code
Link