mirror of
https://github.com/dlang/phobos.git
synced 2025-05-06 02:45:12 +03:00
Merge pull request #4111 from greenify/examples_to_unittest6
std.socket: Examples to unittest [part 6]
This commit is contained in:
commit
7fd53776c6
1 changed files with 1 additions and 13 deletions
14
std/socket.d
14
std/socket.d
|
@ -3479,19 +3479,6 @@ class UdpSocket: Socket
|
|||
* The two sockets are indistinguishable.
|
||||
*
|
||||
* Throws: $(D SocketException) if creation of the sockets fails.
|
||||
*
|
||||
* Example:
|
||||
* ---
|
||||
* immutable ubyte[] data = [1, 2, 3, 4];
|
||||
* auto pair = socketPair();
|
||||
* scope(exit) foreach (s; pair) s.close();
|
||||
*
|
||||
* pair[0].send(data);
|
||||
*
|
||||
* auto buf = new ubyte[data.length];
|
||||
* pair[1].receive(buf);
|
||||
* assert(buf == data);
|
||||
* ---
|
||||
*/
|
||||
Socket[2] socketPair() @trusted
|
||||
{
|
||||
|
@ -3533,6 +3520,7 @@ Socket[2] socketPair() @trusted
|
|||
static assert(false);
|
||||
}
|
||||
|
||||
///
|
||||
unittest
|
||||
{
|
||||
immutable ubyte[] data = [1, 2, 3, 4];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue