Java client as connection acceptor

I’ve seen the Java echo server example at https://github.com/KxSystems/javakdb/blob/master/src/kx/examples/Server.java. My related use case is where the KDB+ server is not allowed to accept an incoming connection - I need it to connect to a listening Java client, which then writes data into KDB+ via a kx.C instance that is instantiated using ServerSocket.  Will this work?  The code already works in ‘client connects’ mode - just need to know whether I can have the KDB+ process make the connection and everything else just works once the kx.C instance is prepared with a live socket between Java client and KDB+.

I don’t know about this kx Java class but it is easy to establish a connection with a Q process - it sends a user name and a password and you need to send back true or false. After this handshake everything goes as usual.

???, 23 ??? 2018 ?., 23:38:45 UTC+3 ??? Stephen Townsend ???:

I’ve seen the Java echo server example at https://github.com/KxSystems/javakdb/blob/master/src/kx/examples/Server.java. My related use case is where the KDB+ server is not allowed to accept an incoming connection - I need it to connect to a listening Java client, which then writes data into KDB+ via a kx.C instance that is instantiated using ServerSocket.  Will this work?  The code already works in ‘client connects’ mode - just need to know whether I can have the KDB+ process make the connection and everything else just works once the kx.C instance is prepared with a live socket between Java client and KDB+.

an example of a daemon https://github.com/CharlesSkelton/babel

the relevant code for accepting and handshake:

https://github.com/KxSystems/javakdb/blob/master/src/kx/c.java#L196