May-16-2019, 08:07 PM
(This post was last modified: May-16-2019, 08:07 PM by LavaCreeperKing.)
Change host to host = 'localhost' on client.
When you try to get the socket host name the socket first needs a host. If you are not connected to a server, there is no host to return a host name. The socket is just an empty socket until you connect to a server. If the client and server are on the same computer host will be 'localhost' I do't know yet what you do if they are on different computers. Also you need to do this:
When you try to get the socket host name the socket first needs a host. If you are not connected to a server, there is no host to return a host name. The socket is just an empty socket until you connect to a server. If the client and server are on the same computer host will be 'localhost' I do't know yet what you do if they are on different computers. Also you need to do this:
from socket import socket, AF_INET, SOCK_STREAM sock = socket(AF_INET, SOCK_STREAM)You might also need to change host = '' on the server code.