modified listen/accept-logic and renamed NL_tcp_listen to NL_tcp_accept