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

Related searches

I have this code to connect with server, and this is fileServer.py on server, i have another file py at client but not test yet, i got problem when run this code, please see the information below

import socket
import threading
import os

def RetrFile(name, sock):
      filename = sock.recv(1024).decode()
      if os.path.isfile(filename):
          message = "EXISTS" + str(os.path.getsize(filename))
          sock.send(message.encode())
          userResponse = sock.recv(1024).decode()
          if userResponse[:2] == "OK":
              with open(filename, 'rb') as f:
                 bytesToSend = f.read(1024)
                 sock.send(bytesToSend)
                 while (bytesToSend !=""):
                     bytesToSend = f.read(1024)
                     sock.send(bytesToSend)
    else:
       sock.send("ERR")
    sock.close()

def Main():
    host = '192.168.0.91'
    port = 8069

    s = socket.socket()
    s.bind((host,port))

    s.listen(5)

    print('Server Started')

    while True:
       c, addr = s.accept()
       print ('Client connected ip: ' + str(addr))
       t = threading.Thread(target = RetrFile, args=('retrThread',c))
       t.start()
   s.close()

if __name__ == '__main__':
     Main()

And when I run it, it show me an Error, I think it is about socket to connect with IP server, is it right?

File "fileServer.py", line 40, in <module>
Main()
File "fileServer.py", line 26, in Main
s.bind((host,port))
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use

How can I fix that? Any suggest? Thanks in advance

I think you are trying to run more than one Odoo server on the same port.

Try this on terminal:

 sudo netstat -nlp | grep 8069

then you will see something like this:

 tcp        0      0 0.0.0.0:8069            0.0.0.0:*               LISTEN      10869/python2    

Kill the process:

sudo kill -9 10869

OR

Change the port number in the fileServer.py.

Then try to start Odoo.

Hope it will help you.

Python - socket.error: [Errno 98] Address already in use, socket. error: [Errno 98] Address already in use. The server by default is attempting to run on port 443, which unfortunetly is required in order for this application to work. Here's the full return from attempting to run the server application. Unable to bind socket, error: [Errno 98] Address already in use The ports are not available to bind. #20903 Comm4nd0 opened this issue Feb 21, 2015 · 16 comments Labels

The error is self explanatory "Address already in use" return getattr(self._sock,name)(*args) socket.error: [Errno 98] Address already in use

@KbiR has already explained it

For windows check this out How can you find out which process is listening on a port on Windows?

OSError: [Errno 98] Address already in use, Pelican.server can encounter an error if you try to start it after it's recently terminated: socket.error: [Errno 98] Address already in use It's  [WARNING ] Unable to bind socket, error: [Errno 98] Address already in use The ports are not available to bind still i have the same issue with the port but it seems to be open. as suggested i have even modified the interface settings

you could use this command to kill the Odoo process already running on that port

fuser -k tcp/8069

and launch your python script again

Server fails with socket.error: [Errno 98] Address already in use , tried the below but didn't work. any ideas? salt-master stop [WARNING ] Unable to bind socket, error: [Errno 98] Address already in use. The ports  How to resolve SOCKET ERROR: Address already in use while submitting email. On Windows systems, when a server uses one or more Transmission Control Protocol/Internet Protocol (TCP/IP) sockets per transaction and the transaction rates are high, it is possible to run out of socket ports needed to create new socket connections.

use this command is the correct sudo systemctl stop odoo11

if you use other version of odoo change the number 11 for your version

Unable to bind socket, error: [Errno 98] Address already in use The , There is obviously another process listening on the port. You might find out that process by using the following command: $ lsof -i :8000. socket.error: [Errno 48] Address already in use I had previously open a connection using the same command for a different website in a different location in my machine. python macos simplehttpserver

python socket.error: [Errno 98] Address already in use, (I use the CPU-ONLY model, because the graphic card can't support CUDA in my computer ) 2.socket.error: [Errno 98] Address already in use: ('0.0.0.0', 5000) My digit vision is 3.0.3. The next section is return. Thanks .

blackHatMonkey changed the title Help, not working! error: [Errno 98] Address already in use Aug 10, 2018 blackHatMonkey closed this Aug 10, 2018 This comment has been minimized.

You would want to kill a process which is already listening to the port you want to use and the process while using the workspaces is labeled something like: "treehou+" . You will a process ID (PID) next to the name and the command which initiated the process in the last column or so.