I have some trouble getting the Socket Server to send messages on it's own.
I am using the demo code there:
https://www.dukascopy.com/wiki/en/devel ... et-channelThe thing is, this code waits for a string, then executes code that matches that string. Then it sends an answer back. But I am trying to get the server to send messages on its own, instead of reacting to an incoming string.
For example, onTick() gets called, and I would like to send a message containing the tick details.
This is my non-working code:
public void onTick(Instrument instrument, ITick tick) throws JFException {
final String message;
message = "instrument"+instrument+": "+tick;
context.executeTask(new ClientTask(message, key));
}
There is no key so the code fails. What do I need to do? How do I get a new key?