Mark,
I think I understand now. When Nichelite performs the callback I need to stop listening on port 10001. This should affect the [RST,ACK] that I am after......
The following worked
1) Start a "SocketHolder = m_listen()"
2) On a callback the active socket will be put in msring and I need to m_close(SocketHolder)
3) Handle communications with the active socket.
4) On the passive socket close -> Rinse and repeat.
I did not fully test the second TCP connect attempt, but it did get rejected. No [RST,ACK] but I did get ICMP messages "Destination unreachable (Port unreachable)". This is right as I stopped listening.
I don't have enough info for NicheLite to set the number of active sockets to 1 for the desired port, which would probably result in the [RST,ACK] from the TCP stack.
As of now I have not found any documentation on how to implement this last feature.
Thanks for your insight and feedback,
Mark