Closed burakakca closed 1 year ago
Server port 9090, client connect 7000?
@VictoryWangCN that's my mistake but the problem is not that
Try modify RSocketClientExample.java
CloseableChannel channel = RSocketServer.create(
SocketAcceptor.forRequestResponse(p -> {
String data = p.getDataUtf8();
logger.info("Received request data {}", data);
Payload responsePayload = DefaultPayload.create("Echo: " + data);
p.release();
return Mono.just(responsePayload);
}))
.bind(TcpServerTransport.create("localhost", 7000))
.doOnNext(cc -> logger.info("Server started on the address : {}", cc.address()))
.block();
channel.onClose().block();
Yes, It's working now. Thanks.
I have another question, maybe you can help me with that. How to send the first request from the server to the client. In all examples doing the first request from the client
You can use forRequestStream or forRequestChannel to send requests from the server, but the first request still needs to be sent from the client
Server
Response
All in one file code;
Expected Response