Package com.mongodb.internal.connection
Class SocketStream
- java.lang.Object
-
- com.mongodb.internal.connection.SocketStream
-
- All Implemented Interfaces:
BufferProvider,Stream
- Direct Known Subclasses:
UnixSocketChannelStream
@Deprecated(since="2021-05-27") public class SocketStream extends java.lang.Object implements Stream
Deprecated.
-
-
Constructor Summary
Constructors Constructor Description SocketStream(ServerAddress address, SocketSettings settings, SslSettings sslSettings, javax.net.SocketFactory socketFactory, BufferProvider bufferProvider)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Deprecated.Closes the connection.ServerAddressgetAddress()Deprecated.The address that this stream is connected to.ByteBufgetBuffer(int size)Deprecated.Gets a buffer with the givens capacity.booleanisClosed()Deprecated.Returns the closed state of the connectionvoidopen()Deprecated.Open the stream.voidopenAsync(AsyncCompletionHandler<java.lang.Void> handler)Deprecated.Open the stream asynchronously.ByteBufread(int numBytes)Deprecated.Read from the stream, blocking until the requested number of bytes have been read.voidreadAsync(int numBytes, AsyncCompletionHandler<ByteBuf> handler)Deprecated.Read from the stream, asynchronously.voidwrite(java.util.List<ByteBuf> buffers)Deprecated.Write each buffer in the list to the stream in order, blocking until all are completely written.voidwriteAsync(java.util.List<ByteBuf> buffers, AsyncCompletionHandler<java.lang.Void> handler)Deprecated.Write each buffer in the list to the stream in order, asynchronously.
-
-
-
Constructor Detail
-
SocketStream
public SocketStream(ServerAddress address, SocketSettings settings, SslSettings sslSettings, javax.net.SocketFactory socketFactory, BufferProvider bufferProvider)
Deprecated.
-
-
Method Detail
-
open
public void open()
Deprecated.Description copied from interface:StreamOpen the stream.
-
getBuffer
public ByteBuf getBuffer(int size)
Deprecated.Description copied from interface:BufferProviderGets a buffer with the givens capacity.- Specified by:
getBufferin interfaceBufferProvider- Parameters:
size- the size required for the buffer- Returns:
- a ByteBuf with the given size, which is now owned by the caller and must be released.
-
write
public void write(java.util.List<ByteBuf> buffers) throws java.io.IOException
Deprecated.Description copied from interface:StreamWrite each buffer in the list to the stream in order, blocking until all are completely written.
-
read
public ByteBuf read(int numBytes) throws java.io.IOException
Deprecated.Description copied from interface:StreamRead from the stream, blocking until the requested number of bytes have been read.
-
openAsync
public void openAsync(AsyncCompletionHandler<java.lang.Void> handler)
Deprecated.Description copied from interface:StreamOpen the stream asynchronously.
-
writeAsync
public void writeAsync(java.util.List<ByteBuf> buffers, AsyncCompletionHandler<java.lang.Void> handler)
Deprecated.Description copied from interface:StreamWrite each buffer in the list to the stream in order, asynchronously. This method should return immediately, and invoke the given callback on completion.- Specified by:
writeAsyncin interfaceStream- Parameters:
buffers- the buffers to writehandler- invoked when the read operation has completed
-
readAsync
public void readAsync(int numBytes, AsyncCompletionHandler<ByteBuf> handler)Deprecated.Description copied from interface:StreamRead from the stream, asynchronously. This method should return immediately, and invoke the given callback when the number of requested bytes have been read.
-
getAddress
public ServerAddress getAddress()
Deprecated.Description copied from interface:StreamThe address that this stream is connected to.- Specified by:
getAddressin interfaceStream- Returns:
- the address
-
close
public void close()
Deprecated.Description copied from interface:StreamCloses the connection.
-
-