Technical article 100844

t_close(NET) does not fully clear up a current connection.

OpenServer 5.0.0OpenServer 5.0.2

Written · Last revised

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);

From the Xinuos technical article database, record 100844. Reproduced with permission. The original is at www.sco.com/ta/100844, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.