Scoutdrago3

Client

Jul 28th, 2015
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. """Lets make a client socket!"""
  2.  
  3. import socket
  4.  
  5. sADDR = (<IP/socket of other computer>)
  6. buff = raw_input("Enter the buffer size:\n")
  7.  
  8. cliSock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  9. cliSock.connect(sADDR)
  10.  
  11. while True:
  12.     cliSock.send(raw_input(">> "))
  13.     message = cliSock.recv(buff)
  14.     if not message:
  15.         break
  16.     print message
  17. cliSock.close()
Advertisement
Add Comment
Please, Sign In to add comment