This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
s = socket.socket() | |
host = socket.gethostname() | |
port = 9009 | |
s.bind((host,port)) | |
print('This host/server ID is: ', host) | |
print('\n',host,'has been binded to',port) | |
print('\nServer is listening for incoming connections') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import os | |
s = socket.socket() | |
host = input('Enter host/server ID: ') | |
port = 9009 | |
s.connect((host,port)) | |
print('This client has successfully connected to the server') | |
while True: |