HP3000-L Archives

September 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Steve Dirickson <[log in to unmask]>
Reply To:
Steve Dirickson <[log in to unmask]>
Date:
Fri, 15 Sep 2000 21:10:54 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (50 lines)
> Many many thanks to Lars et al for pointing me at sockets. I
> had visited
> this area in the past but I didn’t make much sense then, not
> that it does
> now. Anyway I thought I would try to understand IPC/sockets generally
> before moving onto HTTP on port 80.
> ....
> I found that if I run the client program at two terminals at
> the same time,
> the second client is locked out until the first client closes.
>
> OK I thought, I would change the client loop so it restarted
> every time.
> However when I tried this and only running a single client it
> appears to
> hang after some 61 (ipcdest, connect, recv, shutdown, send,
> shutdown) loops
> and then timesout. An immediate run of the client after
> results in an error
> code 4 (Network error: Transport not initialised).

Your list of NetIPC intrinsics doesn't include IPCGIVE or IPCGET, so I'm
guessing that you're doing everything in a single process. Since it also
omits IPCCONTROL, IODONTWAIT and IOWAIT, I further suspect that you're
conducting your activities in blocking mode. If so, it's no surprise that
the second client is locked out until the first one exits; a blocking
process can only service one connected VC socket at a time. If this is the
case, you need to either handle multiple sockets in a single process using
NOWAIT I/O (IPCCONTROL(socket,1,....)) or hand off the connections from the
listening socket to worker processes with IPCGIVE/IPCGET.

Also, what is the "shutdown" in the middle of your sequence? What are you
shutting down, and on what are you sending after said shutdown?

WRT your "hang after some 61...loops" and inability to restart: as
documented in the NetIPC manual,
  "The maximum number of socket descriptors owned by an HP 3000 process at
any given time is 64;"
Based on your description, I'd guess that you're not properly closing down
your sockets, so you're ending up with a bunch of sockets either leaked or
sitting in CLOSE_WAIT or TIME_WAIT (or, even worse, in FIN_WAIT_x). This is
likely related to the issue addressed in the previous paragraph. Proper
socket management and cleanup should solve both problems.

Steve


Steve Dirickson    [log in to unmask]
WestWin Consulting  (360) 598-6111

ATOM RSS1 RSS2