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


Groups > comp.lang.python > #38261

Re: Java NIO server and Python asyncore client

From dieter <dieter@handshake.de>
Subject Re: Java NIO server and Python asyncore client
Date 2013-02-06 08:42 +0100
References <ce1ca918-2bbe-440b-95eb-89dc257ffc9f@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1405.1360136576.2939.python-list@python.org> (permalink)

Show all headers | View raw


foobarometer@gmail.com writes:

> Can someone help answer this?
> http://stackoverflow.com/questions/14698020/java-nio-server-and-python-asyncore-client
>
> Blocking python client works, asyncore doesn't work.

I fear you must tell us which Python version you are using.
Your call to "dispatcher.create_socket" is incompatible with
the code in Python 2.7 (it lacks parameters "family" and "type").


Otherwise, I could not detect a problem in your code.
I assume that "does not work" does not mean "I get an exception"
but means "I do not get anything".

You might need some debugging to detect the problem.

Check "dispatcher.socket_map" after you have set up your connector.
It should contain your connector object and this should
be both "readable()" and "writable()".

If this is the case, I would debug "asyncore.loop":

  "asyncore.dispatcher" treats the socket as "connected"
  as soon as it becomes either "readable" or "writable".

  Both should happen after "connect" is successful. Thus,
  I would look what goes wrong:
  
    *  the socket does not become readable/writable
       
       this would proabably mean that the socket never
       gets connected, maybe because of bad parameters
       to "create_socket".

    *  the channel is not properly registered

    *  bad internal state

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


Thread

Java NIO server and Python asyncore client foobarometer@gmail.com - 2013-02-05 00:09 -0800
  Re: Java NIO server and Python asyncore client dieter <dieter@handshake.de> - 2013-02-06 08:42 +0100
  Re: Java NIO server and Python asyncore client Petri Heinilä <hevi00@gmail.com> - 2013-02-15 01:41 -0800

csiph-web