← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #674852]: [1.1.4] socket connecting only once, then Java Exception

 

Question #674852 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/674852

Description changed to:
Hello all,
I'm trying to have Sikulix exchange information with a server that have to take some actions before each test, I'm using the below code (well, similar, but this one shows exactly the same problem).
For testing reasons so far the server is on my pc.
At first attempt everything runs well and on the receiving side I see "hello world From SikuliX"
When I try to run again the same script without closing the IDE I have a Java Exception, see below since it is very long.

Closing the IDE and reopening it gives me another successful attempt

I'm not an expert of python, so this may be a stupid problem...in case forgive me....
Thank in advance for your help

This is the code on Sikulix (has some additional and unneeded popup for
debug):

import socket
result = Do.popAsk("REadyToconnect?\nclicked within 30 seconds", "testNetWork",30)
if None == result:
  print "nothing to do"
elif result:
    msg="hello world From SikuliX\n"
    data = bytearray( msg)
    client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    client_socket.connect(("192.168.100.1", 5050))
    client_socket.send(data)
    client_socket.close()    
    print "user said yes to\n" + msg
else:
    print "user said no"
exit()  

This is the output from Sikulix;
user said yes to
hello world From SikuliX

[info] Exit code: 0

And this is the exception I get at the second attempt:
ott 08, 2018 3:13:59 PM org.python.netty.channel.AbstractChannel$AbstractUnsafe register
WARNING: Force-closing a channel whose registration task was not accepted by an event loop: [id: 0xf7ef9343]
java.util.concurrent.RejectedExecutionException: event executor terminated
at org.python.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:821)
.... more

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.