NetClient netClient = vertx.createNetClient();
netClient.connect(port, host, ar -> {
if (ar.succeeded()) {
socket = ar.result();
socket.handler(this::onDataReceived);
socket.write(buffer);
}
});
private void onDataReceived(Buffer buffer) {
// i want to use this method return value. so i can get the socket response.
}
the socket handler can not use return value or message.reply thing.
Because i want to expose this data to the web.
So how does your netsocket verticle know when it has all the data it needs from the socket? Surely at that point it can call message.reply, assuming that's when you set up the connection.
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/60710f34-4f6f-443f-861b-70d1d3a5166a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.