From d310b01db1c6f2c8e63a561c40352b17978e1bdb Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sun, 23 Mar 2014 18:24:11 +0000 Subject: Moved the global dispatcher to asyncdispatch. --- lib/pure/net.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/pure/net.nim') diff --git a/lib/pure/net.nim b/lib/pure/net.nim index d40f0949b..2461ece1b 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -347,7 +347,7 @@ type ETimeout* = object of ESynch -proc newSocket(fd: TSocketHandle, isBuff: bool): PSocket = +proc createSocket(fd: TSocketHandle, isBuff: bool): PSocket = assert fd != osInvalidSocket new(result) result.fd = fd @@ -355,15 +355,15 @@ proc newSocket(fd: TSocketHandle, isBuff: bool): PSocket = if isBuff: result.currPos = 0 -proc socket*(domain: TDomain = AF_INET, typ: TType = SOCK_STREAM, +proc newSocket*(domain: TDomain = AF_INET, typ: TType = SOCK_STREAM, protocol: TProtocol = IPPROTO_TCP, buffered = true): PSocket = ## Creates a new socket. ## ## If an error occurs EOS will be raised. - let fd = rawsockets.socket(domain, typ, protocol) + let fd = newRawSocket(domain, typ, protocol) if fd == osInvalidSocket: osError(osLastError()) - result = newSocket(fd, buffered) + result = createSocket(fd, buffered) when defined(ssl): CRYPTO_malloc_init() -- cgit 1.4.1-2-gfad0