Title: socket rcv method lacks optional 2nd parameter, flags
Type: behaviour Severity: normal
Components: Library Versions: Jython 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: zyasoft Nosy List: gary.aviv, zyasoft
Priority: low Keywords:

Created on 2015-02-10.16:53:06 by gary.aviv, last changed 2015-10-29.22:31:35 by zyasoft.

msg9509 (view) Author: gary aviv (gary.aviv) Date: 2015-02-10.16:57:54
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM )
sz = s.recv(4, 256)   

You get:
Traceback (most recent call last):
  File "/tmp/sock_test.jy", line 6, in <module>
    sz = s.recv(4, 256)
TypeError: recv() takes exactly 2 arguments (3 given)  

I also tried 
  sz = s.recv(4, flags=256)
which changed the exception to:
TypeError: recv() got an unexpected keyword argument 'flags'

Also, the flags parameter I am trying to use is socket.MSG_WAITALL
but, socket does not define that attribute.
msg9510 (view) Author: Jim Baker (zyasoft) Date: 2015-02-10.17:57:00
As of 2.7.0 trunk, socket.recv does support the second parameter for flags, but it is quietly ignored.

It's an interesting exercise to match the standard Unix flags ( and similar Windows flags against what we can do with Netty 4. I suppose something like socket.MSG_WAITALL can be implemented, but it's worth pointing out that this flag is not available on Windows. In general, in socket-reboot we have tried to do the intersection of socket support for Windows and Unix systems, because at the end of the day we are just simulating C socket semantics on top of Netty. See my design doc -
Date User Action Args
2015-10-29 22:31:35zyasoftsetpriority: low
versions: - Jython 2.5
2015-07-28 15:06:02zyasoftsetassignee: zyasoft
2015-02-10 17:57:00zyasoftsetnosy: + zyasoft
messages: + msg9510
2015-02-10 16:57:55gary.avivsetmessages: + msg9509
2015-02-10 16:53:06gary.avivcreate