Re: Socket Programming: How to terminate a thread "listening" for UDP packets?



On 16 Jan, 19:15, David Schwartz <dav...@xxxxxxxxxxxxx> wrote:
On Jan 16, 7:44 am, Lars Uffmann <a...@xxxxxxxxxxxxxx> wrote:

What's the "natural" approach to "defuse" a function that is listening
for incoming packets?

There are several ways, some of which naturally fit your situation and
some of which don't:

I'm not sure, but this sounds _similar_ to a problem I'm having at the
moment. I've got a daemon on each of two boxes, tunneling SCTP over
UDP. On each box there is a client connected to 'its' daemon. The
problem I have is that whichever client terminates first, it leaves
the daemon on that box in an unconnectable state.

It seems that the daemon detects that the link to the remote client is
down, and then tries to notify the local client of the changed state,
resulting in a ECONNREFUSED errno. When the local client restarts, it
is unable to reconnect to the daemon for some reason.

The _second_ client to terminate is just fine, and when restarted,
will reconnect to its daemon with no problems.

It's not my code, so I'm struggling to see what is going on...
.



Relevant Pages

  • Two clients with same IP Address behind a captive portal?
    ... I'm trying to build up a box that acts like a transparent proxy ... I would like that clients with both DHCP IP address and STATIC IP ... When a STATIC IP CLIENT connects: ... The ARP daemon sees two different MAC ADDRESS under the same ...
    (comp.os.linux.networking)
  • Re: which IPC should i use?
    ... The LED's are on the RTS an DTS lines, so when the controlling program ... just sends the daemon messages ... to switch on or off a specified LED. ... When the client wants a LED to be turned on, it puts a message on ...
    (comp.unix.programmer)
  • Re: kill -9 not killing a process
    ... >> Don't know about your design, but MySQL has a master daemon that you ... >> daemon from a client which gracefully stops the process, ... > complexities of an industrial strength database. ... I wasn't suggesting you use a database, per se, just a parallel design ...
    (comp.sys.sun.admin)
  • Re: Session management in Linux (long)
    ... The daemon is the business logic of our application. ... This is where knowing what session ... If you intend to have your client operate in both text mode and graphical ... The daemon will never interact with a user/graphics ...
    (comp.os.linux.development.apps)
  • OpenSSH-3.7.1p2 and OPIE
    ... client will not display the challenge. ... when I run 'sshd -d', the *daemon* will print the OPIE challenge, and I ... succesfully logs in. ... has anyone gotten better results with intergrating OPIE with a ...
    (SunManagers)