• Register
0 votes

Problem :

I have looked for solution for literally hours but no luck so I am asking it here.

I am trying to build the chat server using the python's socket module. But when I run the server after my client connects to it and also the server connects, I face following exception:

[WinError 10038] An operation was attempted on something that is not a socket

I have tried to build a drastically reduced server and it works where current server does not. This exception has confused me as it is popping up nearly the line for line.

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

Allow me to explain the couple of things to you:

·    At the server side: Generally you will create a socket, bind it, and listen for the connections.

·    At the client side: Generally you will create a socket and then you will try to connect to the server.

I think the server side is fine in your case but when it comes to the client side you need not have following line:


You should update your code like following example:

ip = ''

port = 1234

sc.connect((ip, port))


while True:


Also please make sure that all your indentations are correct and you are closing your sockets correctly as this is the reason why you are facing this error.

9 7 4
38,600 points

Related questions

0 votes
1 answer 50 views
Problem : I have my web application which is throwing the below error while running in IE: “Illegal operation attempted on a registry key that has been marked for deletion” It works really fine in my Chrome but unfortunately gives the above error in production ... information on my error. And it confuses me as why this is only occurring when trying to use the IE. Any pointers?
asked Jan 6, 2020 alecxe 7.5k points
1 vote
1 answer 74 views
Problem : I am very new to Azure. Recently I have started experiencing the error if I try to connect my database which is currently in the VM Role it is the SQL VM Role from the Azure Website. I am experiencing following issue: SqlException (0x80131904): A connection ... : 0 - The certificate chain was issued by an authority that is not trusted.)] Can someone kindly help me in fixing above error.
asked Apr 2, 2020 morrisBson 3.2k points
0 votes
1 answer 232 views
Problem : I have my website on HostGator and also the dedicated server of my own running SQL Server 2008R2. The connection string I use is the X.X.X.X,1433 which directly points to the IP address of the dedicated server. I have already made the firewall settings on ... by the HostGator tech support team that there would be no problems from their end. Is there anybody who can fix this issue for me?
asked Dec 11, 2019 alecxe 7.5k points
0 votes
1 answer 929 views
Problem : I am using windows 10. I also have Tensorflow on my box.It says "Hello Tensorflow!" to me. However it has all of below before it: 2019-12-05 18:16:01.500579: I T:\src\github\tensorflow\tensorflow\core\platform\ ... \numpy\\.libs\\libopenblas.BNVRK7633HSX7YVO2TADGR4A5KEKXJAW.gfortran-win_amd64.dll' Consider using the--useroption or check the permissions. Any solution on this issue?
asked Dec 7, 2019 alecxe 7.5k points
0 votes
2 answers 68 views
Problem : I am new to Windows 8 OS. I am facing the error while trying to install the IIS manager from the "Turn on off windows features" on my windows 8 machine. I have already installed all the updates on my machine and also rebooted my machine and after ... install the IIS manager. The error is as follows "The function attempted to use a name that is reserved for use by another transaction".
asked Feb 17, 2020 mphil 2.3k points
0 votes
1 answer 3 views
Problem: Hello! I want to know the correct answer to the above mentioned question. Please provide the detailed explanation as I am a beginner and I do not have alot of knowledge.
asked 2 days ago Code Learner 5.5k points
0 votes
1 answer 269 views
Problem: I am new and learning, I need help, can anyone help by filling in the blanks? The ability for a protocol or program to determine that something went wrong is known as ________?
asked Feb 21, 2020 maddi86 5.4k points
0 votes
1 answer 44 views
Problem: In linear programming, a solution that does not simultaneously satisfy all constraints is called an? A. illogical solution. B. intermediate solution. C. impossible solution. D. infeasible solution.
asked Apr 12, 2020 ArifulIslam 5.6k points
0 votes
2 answers 1.2K views
Problem : I am facing below listed very strange error. I am using Apache Server. “413. that’s an error. your client issued a request that was too large. that’s all we know.” How can I fix this error?
asked Feb 15, 2020 mphil 2.3k points
0 votes
2 answers 325 views
Problem : I have installed Java application on my Linux machine and now i am receiving following error : no x11 display variable was set, but this program performed an operation which requires it.
asked Nov 18, 2019 peterlaw 6.9k points