sock: code formatting.
sock: fix a compilation warning.
sock: Correctly return the following events: CCI_EVENT_CONNECT_REQUEST, CCI_EVENT_ACCEPT, CCI_EVENT_CONNECT
+ check length of the message before actually sending it
+ code clean-up.