mirror of
https://github.com/besterprotocol/bformat
synced 2023-12-13 21:30:24 +01:00
Sockets
- 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:
parent
d22455c2f4
commit
b94c433115
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue