I’m using the ScriptExporter to send a command then get the response of that command.
I do this every 1 second to monitor the latest status of the peripheral attached to the robot.
But after some time, the polyscope freezes. Further debugging puts this between 250~350 seconds.
After a lot of debugging, I found it stops at the Socket returnSocket = server.accept();
line in the readValueFromRobot function of ScriptExporter.
I tried fixing it by adding server.setSoTimeout(2000);
right before the accept().
This only prevented polyscope from freezing. After it triggers the timeout, it still does not get the response from the robot.
The command I send using ScriptExporter is as follows:
socket_open(peripheral IP, peripheral port)
socket_send_byte(x) ← multiple lines depending on command and data
socket_read_byte_list(30)
socket_close()
I’m thinking this is more a ServerSocket issue and less a ScriptExporter issue but I know little of either to draw a conclusion.
Anyone have any knowledge about this?
Thanks in advance.