import socket

# IPv4, TCP server
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# host IP, port
host = socket.gethostname()
port = 12345
serversocket.bind((host, port))
serversocket.listen(5)

while True:
    # connect with client socket
    client, address = serversocket.accept()
    print(f"Connection from {address} is now established!")
    client.send(bytes("Welcome to the server!", "utf-8"))
    client.close()