I found this code on github.
import socket
import threading
# Choosing Nickname
nickname = input("Choose your nickname: ")
# Connecting To Server
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(('127.0.0.1', 1122))
There is additional code, and a script for the server. However I didn't think it necessary. Is this chatroom LAN based, or could it work anywhere provided both the client and server were connected to the web.
Also, here is the start of the server script.
# Connection Data
host = '127.0.0.1'
port = 1122
# Starting Server
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((host, port))
server.listen()
Could you please explain what host
and port
refer to?
Thank you!