1
0
Fork 0
mirror of https://github.com/besterprotocol/bformat synced 2023-12-13 21:30:24 +01:00
- 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

View file

@ -3,19 +3,27 @@
*/ */
module bformat.sockets; 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 public class BClient
{ {
/** /**
* Underlying socket * Underlying stream
*/ */
private Socket socket; private Stream stream;
// TODO: comment // TODO: comment
this(Socket socket) this(Socket socket)
{ {
this.socket = socket; this(new SockStream(socket));
}
// TODO: Comment
this(Stream stream)
{
this.stream = stream;
} }
/** /**