Return to Snippet

Revision: 6193
at May 6, 2008 12:07 by cirio


Initial Code
# -*- coding: UTF-8 -*-
import socket

def risp():
   HOST = '127.0.0.1'
   PORT = 90007 
   s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
   s.connect((HOST, PORT))
   text=raw_input('Client::. \t')
   if text=='/quit':
      print 'BYE'
      s.close()
   else:
      s.send(text)
      data = s.recv(1024)
      print 'Server::. \t', `data`
      s.close()
      risp()

risp()

Initial URL

                                

Initial Description
http://lineguides.netsons.org

Initial Title
client example [ function: chat]

Initial Tags
server

Initial Language
Python