May-07-2017, 04:29 PM
(This post was last modified: May-07-2017, 05:06 PM by YevesDraco.)
While coding a chat server, I have encountered a problem when trying to bind the host IP and the port to the socket.
The socket doesn't want to read the host IP (which is just the standard loop-back 127.0.0.1) as a string, float or int.
Any help?
Here is the code in Python 3.5
host = ("127.0.0.1")
port = ("5000")
clients = []
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind((float(host), int(port)))
(BTW this is the first time I have EVER tried to code something like this)
The socket doesn't want to read the host IP (which is just the standard loop-back 127.0.0.1) as a string, float or int.
Any help?
Here is the code in Python 3.5
host = ("127.0.0.1")
port = ("5000")
clients = []
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind((float(host), int(port)))
(BTW this is the first time I have EVER tried to code something like this)