Skip to content Skip to sidebar Skip to footer

Python Server Socket.error: [errno 92] Protocol Not Available

I wanted to make a server, that recives an command from a client, in the form of a String and send a String(or a List of Strings) back. The first time, I run the server and the cli

Solution 1:

In the server code, could you comment (or remove) the following line:

s.setsockopt(socket.AF_INET, socket.SOCK_STREAM, 1)

The setsockopt operation is to define the options of the socket. The level should be SOL_SOCKET and the differents options can be found in setsockopt man page: http://linux.die.net/man/3/setsockopt

An example would be:

s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)

Solution 2:

In my case it ended up being the eventlet library, which is only compatible with Linux Kernel versions >= 3.9. (As found in source code of this file: https://github.com/eventlet/eventlet/blob/f9a3074a3b75f17f76cc04a693dc48a367b99861/eventlet/convenience.py which tried to run sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)).

In my case I was using Flask-SocketIO also was able to switch to gevent, which does not have this limitation.

Post a Comment for "Python Server Socket.error: [errno 92] Protocol Not Available"