diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-06-05 15:06:02 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-06-05 15:06:02 +0100 |
commit | c5708ef1eebb29cabcdb84371805b88891d5042b (patch) | |
tree | ee872a0f38769fd1b83446eb3476d1e93b2e0789 /lib | |
parent | 62376c065733340f5f62b58556e26e9b3ec5a2f0 (diff) | |
parent | af07db28297e0d4d03a1c1e64da524b0119d62fe (diff) | |
download | Nim-c5708ef1eebb29cabcdb84371805b88891d5042b.tar.gz |
Merge branch 'exportnewsocket' of https://github.com/boopcat/Nim into boopcat-exportnewsocket
Conflicts: lib/pure/asyncnet.nim
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/asyncnet.nim | 6 | ||||
-rw-r--r-- | lib/pure/net.nim | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/pure/asyncnet.nim b/lib/pure/asyncnet.nim index d44e5d31f..01c28a13a 100644 --- a/lib/pure/asyncnet.nim +++ b/lib/pure/asyncnet.nim @@ -91,13 +91,13 @@ type # TODO: Save AF, domain etc info and reuse it in procs which need it like connect. -proc newAsyncSocket*(fd: AsyncFD, isBuff: bool): AsyncSocket = +proc newAsyncSocket*(fd: AsyncFD, buffered = true): AsyncSocket = ## Creates a new ``AsyncSocket`` based on the supplied params. assert fd != osInvalidSocket.AsyncFD new(result) result.fd = fd.SocketHandle - result.isBuffered = isBuff - if isBuff: + result.isBuffered = buffered + if buffered: result.currPos = 0 proc newAsyncSocket*(domain: Domain = AF_INET, typ: SockType = SOCK_STREAM, diff --git a/lib/pure/net.nim b/lib/pure/net.nim index 49ca12098..9ce0669bc 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -119,13 +119,13 @@ proc toOSFlags*(socketFlags: set[SocketFlag]): cint = result = result or MSG_PEEK of SocketFlag.SafeDisconn: continue -proc newSocket(fd: SocketHandle, isBuff: bool): Socket = +proc newSocket*(fd: SocketHandle, buffered = true): Socket = ## Creates a new socket as specified by the params. assert fd != osInvalidSocket new(result) result.fd = fd - result.isBuffered = isBuff - if isBuff: + result.isBuffered = buffered + if buffered: result.currPos = 0 proc newSocket*(domain, typ, protocol: cint, buffered = true): Socket = |