0

I'm new to netty and I want to use it for communication between my server-network. I got a Master and various Slaves in my Scenario. The Slaves need to query data from the Master. So that's why I want to create a method that sends something to the Server, and blocks until it receives an answer from the Server. After something is received it returns that. To make things more understandable here is a lil' bit of "pseudo-code":

public String getProperty(String queryString) {
    sendString(queryString);
    return methodThatBlocksUntilSomethingComesBackFromServer();
}

I heard I need to do something with Future<>(). but I am a little confused about that whole ChannelFuture-Thing ...

Thanks in Advance,
Scrayos

Scrayos
  • 101
  • 2
  • 9
  • Firstly start reading up on netty a bit more - http://netty.io/wiki/all-documents.html and also about async I/O. One never blocks in netty land. – jknair Apr 22 '14 at 08:00
  • I didn't found a good solution in all those docs. It's more about the Caveats and the basic Server-Applications. But all the examples are based on ServerSide-Applications that don't expect something that comes back after sending a message. – Scrayos Apr 23 '14 at 12:28
  • there are a lot of client side examples https://github.com/netty/netty/tree/master/example/src/main/java/io/netty/example/http/snoop (look at the client code files) – jknair Apr 23 '14 at 12:34

0 Answers0