本文整理了Java中io.rsocket.Frame.sliceData()
方法的一些代码示例,展示了Frame.sliceData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Frame.sliceData()
方法的具体详情如下:
包路径:io.rsocket.Frame
类名称:Frame
方法名:sliceData
[英]Return ByteBuf that is a ByteBuf#slice() for the frame data
If no data is present, the ByteBuf will have 0 capacity.
[中]返回ByteBuf,它是帧数据的ByteBuf#slice()
如果没有数据,则ByteBuf的容量为0。
代码示例来源:origin: rsocket/rsocket-java
@Override
public ByteBuf sliceData() {
return setupFrame.sliceData();
}
代码示例来源:origin: io.rsocket/rsocket-core
@Override
public ByteBuf sliceData() {
return setupFrame.sliceData();
}
代码示例来源:origin: io.scalecube/scalecube-services-transport-rsocket
@Override
public Mono<InetSocketAddress> bind(int port, ServiceMethodRegistry methodRegistry) {
return Mono.defer(
() -> {
TcpServer tcpServer =
TcpServer.create()
.runOn(loopResources)
.addressSupplier(() -> new InetSocketAddress(port))
.doOnConnection(
connection -> {
LOGGER.info("Accepted connection on {}", connection.channel());
connection.onDispose(
() -> {
LOGGER.info("Connection closed on {}", connection.channel());
connections.remove(connection);
});
connections.add(connection);
});
return RSocketFactory.receive()
.frameDecoder(
frame ->
ByteBufPayload.create(
frame.sliceData().retain(), frame.sliceMetadata().retain()))
.acceptor(new RSocketServiceAcceptor(codec, methodRegistry))
.transport(() -> TcpServerTransport.create(tcpServer))
.start()
.map(server -> this.server = server)
.map(CloseableChannel::address);
});
}
代码示例来源:origin: scalecube/scalecube-services
@Override
public Mono<InetSocketAddress> bind(int port, ServiceMethodRegistry methodRegistry) {
return Mono.defer(
() -> {
TcpServer tcpServer =
TcpServer.create()
.runOn(loopResources)
.addressSupplier(() -> new InetSocketAddress(port))
.doOnConnection(
connection -> {
LOGGER.info("Accepted connection on {}", connection.channel());
connection.onDispose(
() -> {
LOGGER.info("Connection closed on {}", connection.channel());
connections.remove(connection);
});
connections.add(connection);
});
return RSocketFactory.receive()
.frameDecoder(
frame ->
ByteBufPayload.create(
frame.sliceData().retain(), frame.sliceMetadata().retain()))
.acceptor(new RSocketServiceAcceptor(codec, methodRegistry))
.transport(() -> TcpServerTransport.create(tcpServer))
.start()
.map(server -> this.server = server)
.map(CloseableChannel::address);
});
}
代码示例来源:origin: io.scalecube/rsocket-services-transport
@Override
public Mono<InetSocketAddress> bind(int port, ServiceMethodRegistry methodRegistry) {
return Mono.defer(
() -> {
TcpServer tcpServer =
TcpServer.create()
.runOn(loopResources)
.addressSupplier(() -> new InetSocketAddress(port))
.doOnConnection(
connection -> {
LOGGER.info("Accepted connection on {}", connection.channel());
connection.onDispose(
() -> {
LOGGER.info("Connection closed on {}", connection.channel());
connections.remove(connection);
});
connections.add(connection);
});
return RSocketFactory.receive()
.frameDecoder(
frame ->
ByteBufPayload.create(
frame.sliceData().retain(), frame.sliceMetadata().retain()))
.acceptor(new RSocketServiceAcceptor(codec, methodRegistry))
.transport(() -> TcpServerTransport.create(tcpServer))
.start()
.map(server -> this.server = server)
.map(CloseableChannel::address);
});
}
代码示例来源:origin: scalecube/scalecube-services
frame ->
ByteBufPayload.create(
frame.sliceData().retain(), frame.sliceMetadata().retain()))
.transport(() -> TcpClientTransport.create(tcpClient))
.start();
代码示例来源:origin: io.scalecube/scalecube-services-transport-rsocket
frame ->
ByteBufPayload.create(
frame.sliceData().retain(), frame.sliceMetadata().retain()))
.transport(() -> TcpClientTransport.create(tcpClient))
.start();
代码示例来源:origin: io.scalecube/scalecube-gateway-rsocket-websocket
frame ->
ByteBufPayload.create(
frame.sliceData().retain(), frame.sliceMetadata().retain()))
.acceptor(acceptor)
.transport(rsocketTransport)
代码示例来源:origin: io.scalecube/rsocket-services-transport
frame ->
ByteBufPayload.create(
frame.sliceData().retain(), frame.sliceMetadata().retain()))
.transport(() -> TcpClientTransport.create(tcpClient))
.start();
代码示例来源:origin: scalecube/scalecube-services
.frameDecoder(
frame ->
ByteBufPayload.create(frame.sliceData().retain(), frame.sliceMetadata().retain()))
.transport(createRSocketTransport(settings))
.start()
代码示例来源:origin: scalecube/scalecube-services
@Override
public Mono<Gateway> start(
GatewayConfig config, Executor workerPool, Call call, Metrics metrics) {
return Mono.defer(
() -> {
LOGGER.info("Starting gateway with {}", config);
GatewayMetrics metrics1 = new GatewayMetrics(config.name(), metrics);
RSocketGatewayAcceptor acceptor = new RSocketGatewayAcceptor(call.create(), metrics1);
if (workerPool != null) {
loopResources = new GatewayLoopResources((EventLoopGroup) workerPool);
}
WebsocketServerTransport rsocketTransport =
WebsocketServerTransport.create(
prepareHttpServer(loopResources, config.port(), metrics1));
return RSocketFactory.receive()
.frameDecoder(
frame ->
ByteBufPayload.create(
frame.sliceData().retain(), frame.sliceMetadata().retain()))
.acceptor(acceptor)
.transport(rsocketTransport)
.start()
.doOnSuccess(server -> this.server = server)
.doOnSuccess(
server ->
LOGGER.info(
"Rsocket Gateway has been started successfully on {}", server.address()))
.thenReturn(this);
});
}
内容来源于网络,如有侵权,请联系作者删除!