Commit ebdae5e9 authored by Xiaoying Pu's avatar Xiaoying Pu

the test main needed setup()

parent 2b07f82b
......@@ -17,6 +17,7 @@ public class TestUDPController {
public static void main(String[] args) {
UDPController cntrl = new UDPController();
cntrl.setUp();
for (int i = 0; i < util.UDPConstants.TrialSet.length; i++) {
cntrl.sendTrialAndRecvResponse(i);
}
......
import socket
UDP_IP = "127.0.0.1"
UDP_PORT = 9001
UDP_PORT = 9223
MESSAGE = "123,1,START"
sd = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
socket.bind((UDP_IP, UDP_PORT))
while True:
data, addr = sd.recvfrom(1024)
print("recv: ", data)
\ No newline at end of file
sd.sendto(MESSAGE, (UDP_IP, UDP_PORT))
#sd.bind((UDP_IP, UDP_PORT))
#while True:
# data, addr = sd.recvfrom(1024)
# print("recv: ", data)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment