close

[Solved] python socket.error: [Errno 98] Address already in use [closed]

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error python socket.error: [Errno 98] Address already in use [closed] in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How python socket.error: [Errno 98] Address already in use [closed] Error Occurs?

Today I get the following error python socket.error: [Errno 98] Address already in use [closed] in python.

How To Solve python socket.error: [Errno 98] Address already in use [closed] Error ?

  1. How To Solve python socket.error: [Errno 98] Address already in use [closed] Error ?

    To Solve python socket.error: [Errno 98] Address already in use [closed] Error Nothing worked for me except running a subprocess with this command, before calling HTTPServer(('', 443), myHandler):

  2. python socket.error: [Errno 98] Address already in use [closed]

    To Solve python socket.error: [Errno 98] Address already in use [closed] Error Nothing worked for me except running a subprocess with this command, before calling HTTPServer(('', 443), myHandler):

Solution 1

Nothing worked for me except running a subprocess with this command, before calling HTTPServer(('', 443), myHandler):

kill -9 $(lsof -ti tcp:443)

Of course this is only for linux-like OS!

Solution 2

Yes, it is intended. Here you can read detailed explanation. It is possible to override this behavior by setting SO_REUSEADDR option on a socket. For example:

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

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read