Jython2.7.0 and Pyro4

John Hayes <[email protected]>
Newsgroups gmane.comp.lang.jython.user
Message-ID <[email protected]>
Dear all,

I'm trying to use Pyro4 with Jython2.7.0. I've installed both 'serpent-1.11' (a Pyro4-dependent serializer) and 'Pyro4-4.40' itself seemingly successfully on Windows 7 using 'jython setup.py install' for the respective source packages.

However, if I run this simple example of starting a Pyro server:
> import Pyro4                                                                                                                                                                                       
>                                                                                                                                                                                                    
> class GreetingMaker(object):                                                                                                                                                                       
>     def get_fortune(self, name):                                                                                                                                                                   
>         return "Hello, {0}. Here is your fortune message:\n" \                                                                                                                                     
>                "Behold the warranty -- the bold print giveth and the fine print taketh away.".format(name)                                                                                         
>                                                                                                                                                                                                    
> daemon = Pyro4.Daemon(host="192.168.10.106")                # make a Pyro daemon                                                                                                                   
> uri = daemon.register(GreetingMaker)   # register the greeting maker as a Pyro object                                                                                                              
>                                                                                                                                                                                                    
> print uri      # print the uri so we can use it in the client later                                                                                                                                
> daemon.requestLoop()                   # start the event loop of the server to wait for calls

I get the following error:
> Traceback (most recent call last):                                                                                                                                                                 
>   File "greeting-server.py", line 8, in <module>                                                                                                                                                   
>     daemon = Pyro4.Daemon(host="192.168.10.106")                # make a Pyro daemon                                                                                                               
>   File "C:\jython2.7.0\Lib\site-packages\pyro4-4.40-py2.7.egg\Pyro4\core.py", line 901, in __init__                                                                                                
>     self.transportServer.init(self, host, port, unixsocket)                                                                                                                                        
>   File "C:\jython2.7.0\Lib\site-packages\pyro4-4.40-py2.7.egg\Pyro4\socketserver\threadpoolserver.py", line 103, in init                                                                           
>     self.sock = socketutil.createSocket(bind=bind_location, reuseaddr=Pyro4.config.SOCK_REUSE, timeout=Pyro4.config.COMMTIMEOUT, noinherit=True, nodelay=Pyro4.config.SOCK_NODELAY)                
>   File "C:\jython2.7.0\Lib\site-packages\pyro4-4.40-py2.7.egg\Pyro4\socketutil.py", line 283, in createSocket                                                                                      
>     bindOnUnusedPort(sock, bind[0])                                                                                                                                                                
>   File "C:\jython2.7.0\Lib\site-packages\pyro4-4.40-py2.7.egg\Pyro4\socketutil.py", line 479, in bindOnUnusedPort                                                                                  
>     sock.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1)                                                                                                                              
>   File "C:\jython2.7.0\Lib\_socket.py", line 1367, in meth                                                                                                                                         
>     return getattr(self._sock,name)(*args)                                                                                                                                                         
>   File "C:\jython2.7.0\Lib\_socket.py", line 357, in handle_exception                                                                                                                              
>     return method_or_function(*args, **kwargs)                                                                                                                                                     
>   File "C:\jython2.7.0\Lib\_socket.py", line 357, in handle_exception                                                                                                                              
>     return method_or_function(*args, **kwargs)                                                                                                                                                     
>   File "C:\jython2.7.0\Lib\_socket.py", line 1204, in setsockopt                                                                                                                                   
>     raise error(errno.ENOPROTOOPT, "Protocol not available")                                                                                                                                       
> _socket.error: [Errno 10042] Protocol not available


This seems like a similar problem that someone else was recently having on the mailing list that appears rooted in the call to setsockopt:
http://sourceforge.net/p/jython/mailman/message/34127525/

Is this a bug that has already been reported (I couldn't find it), and/or does anyone have any potential ideas for a workaround solution?

I really appreciate any help that can be offered!

All the best,

John


------------------------------------------------------------------------------
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.