Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##Asynchronous Chat Client
- ##Waterlgndx
- ##Chat Client Code based on the first 2 youtube videos posted by SolidShellSecurity :
- ## https://www.youtube.com/watch?v=qELZAi4yra8
- ## https://www.youtube.com/watch?v=Dip7_U12_uU
- ## I'm using Python3.4.1 on Windows 7.
- from socket import *
- HOST = 'localhost' #in order to get the client to work host had to be filled in
- PORT=6014
- s = socket(AF_INET,SOCK_STREAM)
- s.connect((HOST,PORT))
- while True:
- message = input("Message : ")
- s.send(bytes(message, 'UTF-8'))
- print ("Awaiting reply")
- reply = s.recv(1024)
- print ("Received :", reply.decode('UTF-8'))
- s.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement