- Underlying transport is now a river-based `Stream`
- Second constructor added which takes in a `Stream`, the original constructor now calls it with an adhoc created `SockStream` to wrap the consumed `Socket`
This commit is contained in:
Tristan B. Velloza Kildaire 2023-04-30 00:14:05 +02:00
parent d22455c2f4
commit b94c433115
1 changed files with 12 additions and 4 deletions

View File

@ -3,19 +3,27 @@
*/
module bformat.sockets;
import std.socket : Socket, SocketFlags, MSG_WAITALL;
import std.socket : Socket;
import river.core;
import river.impls.sock : SockStream;
public class BClient
{
/**
* Underlying socket
* Underlying stream
*/
private Socket socket;
private Stream stream;
// TODO: comment
this(Socket socket)
{
this.socket = socket;
this(new SockStream(socket));
}
// TODO: Comment
this(Stream stream)
{
this.stream = stream;
}
/**