Problem
Using TLI to implement a TCP/IP server, the t_close() routine does not fully clear up a current connection. Until the closed connection has timed out within the kernel TCP/IP stack, a new server is unable to post a listen to the required well-known port number. If the t_close(NET) is preceded by a t_snddis(NET), the connection is cleaned up immediately.
However, if "tirdwr" has been pushed onto the stream, then t_snddis(NET) cannot be called directly, and is not called by the close(S) routine.
Solution
This has been reported to SCO Engineering. To work around this, the server needs to use the t_close(NET) function along with t_snddis(NET) and an appropriate ioctl(S) call, such as the following:
ioctl(fd, I_POP, NULL);
t_snddis(fd, NULL);
t_close(fd);