Rename rawsockets module to nativesockets
This change was done to avoid confusion with TCP/IP raw sockets. Native sockets module represents handling native system low level socket API in general and is not just limited anyhow to TCP/IP raw sockets. A stub lib/deprecated/pure/rawsockets.nim module has been added as compatibility layer for old code using rawsockets, so this change will not break existing code.
This commit is contained in:
parent
3fe5731777
commit
be991ed413
16 changed files with 91 additions and 65 deletions
|
|
@ -11,7 +11,7 @@ include "system/inclrtl"
|
|||
import sockets, strutils, parseutils, times, os, asyncio
|
||||
|
||||
from asyncnet import nil
|
||||
from rawsockets import nil
|
||||
from nativesockets import nil
|
||||
from asyncdispatch import PFuture
|
||||
## **Note**: This module is deprecated since version 0.11.3.
|
||||
## You should use the async version of this module
|
||||
|
|
@ -55,7 +55,7 @@ type
|
|||
user*, pass*: string
|
||||
address*: string
|
||||
when SockType is asyncnet.AsyncSocket:
|
||||
port*: rawsockets.Port
|
||||
port*: nativesockets.Port
|
||||
else:
|
||||
port*: Port
|
||||
|
||||
|
|
|
|||
14
lib/deprecated/pure/rawsockets.nim
Normal file
14
lib/deprecated/pure/rawsockets.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import nativesockets
|
||||
export nativesockets
|
||||
|
||||
{.warning: "rawsockets module is deprecated, use nativesockets instead".}
|
||||
|
||||
template newRawSocket*(domain, sockType, protocol: cint): expr =
|
||||
{.warning: "newRawSocket is deprecated, use newNativeSocket instead".}
|
||||
newNativeSocket(domain, sockType, protocol)
|
||||
|
||||
template newRawSocket*(domain: Domain = AF_INET,
|
||||
sockType: SockType = SOCK_STREAM,
|
||||
protocol: Protocol = IPPROTO_TCP): expr =
|
||||
{.warning: "newRawSocket is deprecated, use newNativeSocket instead".}
|
||||
newNativeSocket(domain, sockType, protocol)
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
## **Warning:** Since version 0.10.2 this module is deprecated.
|
||||
## Use the `net <net.html>`_ or the
|
||||
## `rawsockets <rawsockets.html>`_ module instead.
|
||||
## `nativesockets <nativesockets.html>`_ module instead.
|
||||
##
|
||||
## This module implements portable sockets, it supports a mix of different types
|
||||
## of sockets. Sockets are buffered by default meaning that data will be
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue