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.
--
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+un...@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/00a060fa-fad7-45bf-afb7-99ec3ae345df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
NetClient netClient = vertx.createNetClient();
netClient.connect(port, host, ar -> {
if (ar.succeeded()) {
socket = ar.result();
socket.handler(buff -> {
ctx.response().write(buff);
});
socket.endHandler( v -> {
ctx.response.end();
});
socket.write(buffer);
}
});
});