On Thu, 14 Jun 2018 23:42:06 +0900,
Carlos Ferreira wrote:
> 
> Hello to all!
> 
> I'm having some issues regarding the use of TCP sockets in ryu apps.
> 
> After spwaning a TCP server using
> 
> hub.spawn(eventlet.serve, eventlet.listen((str(ip), port)), client_handler)
> 
> where the client_handler will handle each client request, it seems
> that the TCP Socket passed to the handler, does not work as predicted.
> 
> I understand that the sockets are in non-blocking mode and that
> eventlet patches the sockets to make them workable with the coroutines
> mechanism, but it seems that the socket does not raise any kind of
> exception when there's zero data to be read from the underlying
> buffer. If my app keeps calling the recv method from a socket object,
> the recv will continue to return zero.
> 
> Is ryu modifying the behaviour of the TCP sockets or is there a
> specific way to use TCP Sockets in Ryu?

The question is not specific to ryu but rather a generic eventlet question.

As long as you are using the monkey_patch'd version of socket object,
it should behave as a usual blocking I/O.

Usually zero bytes reads mean EOF. Please check your code.

--
IWAMOTO Toshihiro

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to