Error Socket connection

As I said, you'll need to look into the java class docs. When I did it we had to convert our data into an array of bytes and send that down the socket, then read a response.

Using code like:

from java.net import Socket as javaSocket
import jarray
skt = javaSocket(ip_addr, port) #Java Socket declare
out_stream = skt.getOutputStream() # set socket send data stream

b_msg = jarray.array(to_convert_b_msg,'b') # Create Java array object for data transmission
		
out_stream.write(b_msg,0,len(b_msg)) # Write Data

This code won't work obviously but should be able to start to look up Java docs on how to implement for your case.

We did find that it massively reduced the memory leaking, so worth the time investment, but my java/Jython skills are pretty poor so maybe isn't super complciated to others.

This is the thread people helped me out on, though took some extra time to figure out how to get it working after

1 Like