Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import socket
- from BigRobot import Move
- from BigRobot import Sensores
- TCP_IP = '127.0.0.1'
- TCP_PORT = 5005
- BUFFER_SIZE = 20 # Normally 1024, but we want fast response
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.bind((TCP_IP, TCP_PORT))
- s.listen(1)
- conn, addr = s.accept()
- print 'Connection address:', addr
- while 1:
- data = conn.recv(BUFFER_SIZE)
- if not data: break
- print "received data:", data
- m = Move(data)
- m.mover()
- conn.send(data) # echo
- print "=> " ,data
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement