python socket programming OSError: [WinError 10038] an operation was attempted on something that is not a socket

python socket programming OSError: [WinError 10038] an operation was attempted on something that is not a socket

You are closing the clientsock after reading only part of the data.

clientsock.close()

is at the wrong level of indentation. Move it to the left by one step.

The problem is with close().
after connection get close you need to initialize the connection again

add this line inside while loop

serversock = socket(AF_INET, SOCK_STREAM)

python socket programming OSError: [WinError 10038] an operation was attempted on something that is not a socket

Related Posts

Leave a Reply

Your email address will not be published.