Re: How to release socket connection on Proxy object

Pierre PACORY <[email protected]>
Newsgroups gmane.comp.python.pyro
Message-ID <CAKq=qT-8_fHQdqJ=s-zLwjCsrt8rjUht5cHjmbTNVLwY8LTdSw@mail.gmail.com>
it doesn't seem to work ...
the socket is still in TIME_WAIT with a netstat

Here a simple code for server :


# SERVER TEST
import Pyro4
import sys

class test(object):
    def method(self, arg):
        return arg*2

# Pyro4 CONFIG
Pyro4.config.HMAC_KEY="monsecret"

# MAIN
daemon=Pyro4.Daemon(host="localhost",port=8888)
tab={}
for i in range(1000):
  tab[i] = test()
  uri=daemon.register(titi[i],"test%d" % i)
  print uri

daemon.requestLoop()


And for client :

# CLIENT TEST
import Pyro4

# Pyro4 CONFIG
Pyro4.config.HMAC_KEY="monsecret"

# use the URI that the server printed:
for i in range(1000):
  uri = "PYRO:test@localhost:8888"
  with Pyro4.Proxy(uri) as obj:
     print obj.method(i)
     obj._pyroRelease() # ??? here a PyroRelease ???


2013/1/9 Irmen de Jong <[email protected]>

> On 5-1-2013 14:15, Pierre PACORY wrote:
> > I found a solution on linux (for windows don't know ...)
> > just edit thoses 2 "proc" files and add "1"
> >
> > *echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle*   (It enables fast
> recycling of TIME_WAIT
> > sockets)
> > *echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse*  (This allows reusing sockets
> in TIME_WAIT
> > state for new connections when it is safe from protocol viewpoint)
> >
> > The socket close immediatlly after the return of the Proxy object Method
> >
> > Hope that could help
>
>
> ... is there something wrong with proxy._pyroRelease() ?
>
> Irmen
>
>
>
> ------------------------------------------------------------------------------
> Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
> and much more. Keep your Java skills current with LearnJavaNow -
> 200+ hours of step-by-step video tutorials by Java experts.
> SALE $49.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122612
> _______________________________________________
> Pyro-core mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyro-core
>

------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612

_______________________________________________
Pyro-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyro-core
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.