code segment for the implementation of an "asynchronous mode" tcplink