An Uppercase Client Using TCP : TCP : Network PYTHON examples


PYTHON examples » Network » TCP »

 

An Uppercase Client Using TCP


 
import socket
import netstring

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.1', 8081))
while 1:
    arg = raw_input("Send: ")
    if not arg:
        netstring.writens(s, "end")
        break
    netstring.writens(s, arg)
    ret = netstring.readns(s)
    print "Returned:", ret
s.close()

   
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Network
» TCP