Merge branch 'exportnewsocket' of https://github.com/boopcat/Nim into boopcat-exportnewsocket

Conflicts:
	lib/pure/asyncnet.nim
This commit is contained in:
Dominik Picheta 2015-06-05 15:06:02 +01:00
commit c5708ef1ee
2 changed files with 6 additions and 6 deletions

View file

@ -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 =