客户端程序

#!/usr/bin/env python

#

#-*-coding:utf-8-*-

#

 

from socket import *

 

HOST = '192.168.43.90'  # // need to change ip

PORT = 6666;

BUFSIZE = 1024;

ADDR=(HOST,PORT)

 

tcpCliSock = socket(AF_INET,SOCK_STREAM)

tcpCliSock.connect(ADDR)

 

while True:

  print"socket client start !!"

  data = raw_input ('>')

  if not data:

    break

  tcpCliSock.send(data)

  #data = tcpCliSock.recv(BUFSIZE)

  #if not data:

    #break

  print data

tcpCliSock.close()

posted @ 2017-09-14 19:49  竹之轩  阅读(149)  评论(0编辑  收藏  举报