minor, allow to initiate handshake and goodbye procedures on user-provided sockets

This changeset provides the methods handshake() and wavegoodbye() in the posix client socket.
The responsibility to connect to the TWS now lies with the user in exchange for greater
control over the socket.

handshake() must be called 3 times.  Once to send off the handshake token (ideally when
the socket is writable), once to receive the servers acknowledgement (socket should be
readable of course) and once to set the client id.

The wavegoodbye() is comparatively simple.  It will disassociate internal resources from
the socket and forget about the socket altogether.

Signed-off-by: Sebastian Freundt <freundt@ga-group.nl>
fix, PEBKAC, initialise the hnd_shk_state variable

Signed-off-by: Sebastian Freundt <freundt@ga-group.nl>
minor, split handshake() into handshake setter and driver

With the setter the socket and client id is set, with the driver the actual handshake process is
advanced step by step.

Signed-off-by: Sebastian Freundt <freundt@ga-group.nl>
minor, as a special service hook into onSend() and onReceive() and ...

... continue the handshake process.

Signed-off-by: Sebastian Freundt <freundt@ga-group.nl>
minor, differentiate between unknown handshake state and the clean state

This actually facilitates that the user can still use eConnect*() functions.

Signed-off-by: Sebastian Freundt <freundt@ga-group.nl>
minor, survive eDisconnect() if handshake-API has been chosen, ...

If so eDisconnect() will fall back to a eDisconnectBase().

Signed-off-by: Sebastian Freundt <freundt@ga-group.nl>
minor, provide handshakeComplete() method

Signed-off-by: Sebastian Freundt <freundt@ga-group.nl>
minor, change procedure to go through the handshake:

Now handshake() upon error returns -1.  handshake() when finished returns 1 (so handshakeComplete() has gone)
and handshake() in the process of shaking hands returns 0.
That way the handshake process can be implemented as:

while ((rc = handshake()) == 0);

and if rc comes back as 1 the handshake was successful, or as -1, then there
was an error on the way.

Signed-off-by: Sebastian Freundt <freundt@ga-group.nl>
merge again functions eDisconnect() and wavegoodbye()

Note this also fixes that we must set m_fd = -1 always in
eDisconnect().
Merge branch 'nosockopt'

* nosockopt:
  merge again functions eDisconnect() and wavegoodbye()
  minor, change procedure to go through the handshake:
  minor, provide handshakeComplete() method
  minor, survive eDisconnect() if handshake-API has been chosen, ...
  minor, differentiate between unknown handshake state and the clean state
  minor, as a special service hook into onSend() and onReceive() and ...
  minor, split handshake() into handshake setter and driver
  fix, PEBKAC, initialise the hnd_shk_state variable
  minor, allow to initiate handshake and goodbye procedures on user-provided sockets