win32 socket, "Operation not supported"

From: David Konerding (dek_at_compbio.berkeley.edu)
Date: 12/12/03


Date: Fri, 12 Dec 2003 17:44:16 +0000 (UTC)


Hello,

I have written an app which opens a TCP connection to a server and uses a protocol to communicate with it.
Specifically, I've written a python IMD client for the molecular dynamics application 'NAMD' (do searches for IMD and NAMD if you want to learn more).

The protocol is very simple: both ends of the TCP connection can send messages to the other side at any time; when data is
available on a read socket, a full packet (with known size) is read in a blocking fashion from the socket.

This is used, on the client side, to make requests of the molecular dynamics engine (such as "speed up", or "slow down", or "quit").
The server side periodically sends updates on the state of the molecular dynamics engine (current step, atomic coords, etc).

This all works fine on linux: I can connect, and send and receive messages as necessary.

However, on Windows, I can connect and complete the initial handshake, and receive periodic updates, but when I try to send a message
to the server, socket.send gets an "Operation not supported".

>From my reading of the win32 docs, the socket send call returns this in a couple of situations:
when a two-way socket had one half shut down and the send would have used the shut down direction, or
when an out of band message was sent on a socket type which does not support it (such as UDP).

Neither of these situations are true. When I re-code the app in C, the problem doesn't occur. Anybody got some suggestions?
(PS: the socket I/O is set to blocking, and the Nagle algorithm is disabled).

Dave



Relevant Pages

  • Re: I want to write a network printer server...
    ... Then why not just make your printer a shared printer? ... server of your devising, so you can make it do anything you want. ... Open a socket, start sending data. ... you could use a protocol where you send the ...
    (microsoft.public.vc.mfc)
  • Re: Letting a Python application phone home
    ... You need to define a protocol for the communication ... Look at the python module "socket" resp. ... "SocketServer" for low level tcp functions. ... let your program contact the server periodically. ...
    (comp.lang.python)
  • Re: win32 socket, "Operation not supported"
    ... > uses a protocol to communicate with it. ... > fashion from the socket. ... > server side periodically sends updates on the state of the molecular ... the approach you take sounds a little strange - if you communicate ...
    (comp.lang.python)
  • Re: Wrapping TCP communications in HTTP
    ... HTTP is a half-duplex protocol. ... The send socket is used to send all requests. ... so the server can return any data it has. ...
    (microsoft.public.win32.programmer.networks)
  • Re: win32 socket, "Operation not supported"
    ... protocol to communicate with it. ... > The protocol is very simple: both ends of the TCP connection can send ... blocking fashion from the socket. ... When I re-code the app in C, ...
    (comp.lang.python)