示例#1
0
def main():

    print "hello server starting"

    fxaPort = int(sys.argv[1])
    emuIp = sys.argv[2]
    emuPort = int(sys.argv[3])

    debug = False
    if len(sys.argv) == 5:
        debug = True

    s = RxpServerSocket(debug)
    s.bind(emuIp, emuPort, fxaPort)
    s.listen()
    newSocket = None
    while not s.accept():
        pass

    #test post
    foo = s.recv(2000)
    msg = foo.split(" ")
    if msg[0] == "pr":
        print "post request"
        foo = "p /.END"
        s.send(foo)
        foo = s.recv(3000)
        msg = foo.split(" ")
        if msg[0] == "pm":
            s.send("pcompleted/.END")
示例#2
0
def main():

	print "hello server starting"

	fxaPort = int(sys.argv[1])
	emuIp = sys.argv[2]
	emuPort = int(sys.argv[3])

	debug = False
	if len(sys.argv) == 5:
		debug = True


	s = RxpServerSocket(debug)
	s.bind(emuIp, emuPort, fxaPort)
	s.listen()
	newSocket = None
	while not s.accept():
		pass

	#test post
	foo = s.recv(2000)
	msg = foo.split(" ")
	if msg[0] == "pr":
		print "post request"
		foo = "p /.END"
		s.send(foo)
		foo= s.recv(3000)
		msg = foo.split(" ")
		if msg[0] == "pm":
			s.send("pcompleted/.END")
示例#3
0
def main():

	print "hello server starting"

	fxaPort = int(sys.argv[1])
	emuIp = sys.argv[2]
	emuPort = int(sys.argv[3])

	debug = False
	if len(sys.argv) == 5:
		debug = True


	s = RxpServerSocket(debug)
	s.bind(emuIp, emuPort, fxaPort)

	s.listen()

	newSocket = None
	while not newSocket:
		newSocket = s.accept()


	# foo = s.recv(3000)
	# print "--------------------------", foo, "------------------------"



	foo = s.recv(3000)

	if foo == "NEED DATA":
		print "Client needs data"
		print "reading file"
		readFile = open("Alice.txt", "rb")
		nextData = readFile.read()
		s.send(nextData)
	if foo == "SEND DATA":
		print "Client is sending data"
		s.recv(3000)