Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- host="192.168.1.18" # Set the server address to variable host
- port=4447 # Sets the variable port to 4446
- from socket import * # Imports socket module
- s=socket(AF_INET, SOCK_STREAM)
- s.bind((host,port)) # Binds the socket. Note that the input to
- # the bind function is a tuple
- s.listen(1) # Sets socket to listening state with a queue
- # of 1 connection
- print "Listening for connections.. "
- q,addr=s.accept()
- while True:
- line = sys.stdin.readline()
- sp1 = line.split (' ')
- sp1 = filter(None, sp1)
- if sp1[0] == "quat":
- q.send(sp1[1] +";"+ sp1[2] + ";"+ sp1[3]+";"+sp1[4]+"\n")
- s.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement