Package io.activej.csp.net
Class MessagingWithBinaryStreaming<I,O>
java.lang.Object
io.activej.async.process.AbstractAsyncCloseable
io.activej.csp.net.MessagingWithBinaryStreaming<I,O>
- All Implemented Interfaces:
io.activej.async.process.AsyncCloseable,io.activej.common.initializer.WithInitializer<MessagingWithBinaryStreaming<I,,O>> Messaging<I,O>
public final class MessagingWithBinaryStreaming<I,O>
extends io.activej.async.process.AbstractAsyncCloseable
implements Messaging<I,O>, io.activej.common.initializer.WithInitializer<MessagingWithBinaryStreaming<I,O>>
Represents a simple binary protocol over for communication a TCP connection.
-
Field Summary
Fields inherited from class io.activej.async.process.AbstractAsyncCloseable
eventloopFields inherited from interface io.activej.async.process.AsyncCloseable
STATIC -
Method Summary
Modifier and TypeMethodDescriptionstatic <I,O> MessagingWithBinaryStreaming<I, O> create(AsyncTcpSocket socket, ByteBufsCodec<I, O> serializer) protected voidio.activej.promise.Promise<I>receive()ChannelSupplier<io.activej.bytebuf.ByteBuf>io.activej.promise.Promise<Void>ChannelConsumer<io.activej.bytebuf.ByteBuf>io.activej.promise.Promise<Void>toString()Methods inherited from class io.activej.async.process.AbstractAsyncCloseable
closeEx, doSanitize, getException, isClosed, onCleanup, sanitize, setCloseableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.activej.async.process.AsyncCloseable
close, closeExMethods inherited from interface io.activej.common.initializer.WithInitializer
withInitializer
-
Method Details
-
create
public static <I,O> MessagingWithBinaryStreaming<I,O> create(AsyncTcpSocket socket, ByteBufsCodec<I, O> serializer) -
receive
-
send
-
sendEndOfStream
- Specified by:
sendEndOfStreamin interfaceMessaging<I,O>
-
sendBinaryStream
- Specified by:
sendBinaryStreamin interfaceMessaging<I,O>
-
receiveBinaryStream
- Specified by:
receiveBinaryStreamin interfaceMessaging<I,O>
-
onClosed
- Overrides:
onClosedin classio.activej.async.process.AbstractAsyncCloseable
-
toString
-