socketrange ~master
Minimal range wrapper of socket
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
socketrange
Simple range wrapper of socket for D.
Usage
import std.algorithm : equal;
import std.socket : socketPair;
import socketrange;
void main() {
auto pair = socketPair();
/// Wrap as OutputRange
auto writer = SocketOutputRange!char(pair[0]);
/// Wrap as InputRange of char
auto reader = SocketInputRange!char(pair[1]);
write.put("foobar");
writer.close();
assert(equal(reader, "foobar"));
}
struct SocketOutputRange(E)
Wrap socket as OutputRange of E
.
E
can be void
to put any types.
struct SocketInputRange(T)
Wrap socket as InputRange of T
.
struct SocketRange(In, Out = In)
Wrap socket as Output/InputRange of In.
Out
can be void
to put any types.
- ~master released 8 years ago
- ukatama/socketrange
- MIT
- Copyright © 2015, ukatama
- Authors:
- Dependencies:
- none
- Versions:
-
1.0.1 2016-Apr-18 1.0.0 2015-Dec-14 0.2.0 2015-Dec-03 0.1.1 2015-Dec-02 0.1.0 2015-Dec-02 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
111 downloads total
-
- Score:
- 0.8
- Short URL:
- socketrange.dub.pm