Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71008

Re: xmlrpc: problems with socket handling, close, shutdown of server, TIME_WAIT, ...

From dieter <dieter@handshake.de>
Subject Re: xmlrpc: problems with socket handling, close, shutdown of server, TIME_WAIT, ...
Date 2014-05-07 08:43 +0200
References <01237970-87cd-4d29-a944-09e64b8efeee@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.9725.1399445018.18130.python-list@python.org> (permalink)

Show all headers | View raw


thomas.lehmann.private@googlemail.com writes:

> ...
> taking the xml-rpc derived from standard example is working - basically - but with following scenario I do not understand the problem. Maybe you can help:
>
>  - one Unittest that does create the xmlrpc server in a thread
>    in "setUp" and shutdown of it in tearDown.
>    The xml-rcp server does store/load a value for a key.
>    (It's for testing/learning purpose)
>
> Problem(s):
>
>  - If I run the test method twice (copy and paste and rename)
>    then I get a "error: [Errno 98] Address already in use"
>    (I assumend the tearDown would have closed all sockets)

For reliability reasons (their might be (communication) packets under way
that may arrive at the wrong partner), a port stays "in use"
for twice (I think) the maximal packet lifetime after its "shutdown".
This is a TCP (not a Python) property.
There is a TCP(socket) option to supress this.

For the details, consult the TCP specification.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

xmlrpc: problems with socket handling, close, shutdown of server, TIME_WAIT, ... thomas.lehmann.private@googlemail.com - 2014-05-06 09:07 -0700
  Re: xmlrpc: problems with socket handling, close, shutdown of server, TIME_WAIT, ... dieter <dieter@handshake.de> - 2014-05-07 08:43 +0200

csiph-web