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:
s.bind(("127.0.0.1",port))
You should update your code like following example:
ip = '127.0.0.1'
port = 1234
sc.connect((ip, port))
sc.send("hello".encode("utf-8"))
while True:
sc.send(input().encode("utf-8"))
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.