Server and Client Socket problem

José Carlos josecarlos at siadv.com
Fri Jan 23 07:50:00 EST 2004


Hi.

I am starting a server socket program. I send data from client socket but
the server don´t recived anything.

This is my python code:

Server:

import socket
        def run():
servidor = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
servidor.bind(('localhost', 6969))
servidor.listen(1)
while 1:
 (conexion, direccion) = servidor.accept()
datos = conexion.recv(4069)
 print "Servidor Recibe", datos
                if datos == "quit":
                    servidor.close()
                break

        run()


Client:

 import socket
        def run():
cliente = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 cliente.connect(('localhost', 6969))
  except:
                   print "No he podido Conectar con el Servidor"
            return
            datos = '12345678'
cliente.send(datos)
          #cliente.close()

        run()


I am a new python user. what can i do?

Thank you.

Regards.
José Carlos





More information about the Python-list mailing list