summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAdam Strzelecki <ono@java.pl>2015-09-30 13:36:43 +0200
committerAdam Strzelecki <ono@java.pl>2015-10-03 19:45:41 +0200
commitbe991ed413d57ec90b4494f4be945d11c85365f4 (patch)
treeed5c6c4b6502a4bc3020c220ab561c7e662da9e4 /tests
parent3fe573177715b1c21d34e79a113862d298741c01 (diff)
downloadNim-be991ed413d57ec90b4494f4be945d11c85365f4.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/async/tasyncawait.nim6
-rw-r--r--tests/async/tasyncconnect.nim2
-rw-r--r--tests/async/tasynceverror.nim4
-rw-r--r--tests/cpp/tnativesockets.nim (renamed from tests/cpp/trawsockets.nim)2
-rw-r--r--tests/macros/tgensym.nim4
-rw-r--r--tests/modules/texport.nim2
6 files changed, 10 insertions, 10 deletions
diff --git a/tests/async/tasyncawait.nim b/tests/async/tasyncawait.nim
index e5895abe1..443f769cd 100644
--- a/tests/async/tasyncawait.nim
+++ b/tests/async/tasyncawait.nim
@@ -2,7 +2,7 @@ discard """
   file: "tasyncawait.nim"
   output: "5000"
 """
-import asyncdispatch, rawsockets, net, strutils, os
+import asyncdispatch, nativesockets, net, strutils, os
 
 var msgCount = 0
 
@@ -18,7 +18,7 @@ proc sendMessages(client: TAsyncFD) {.async.} =
 
 proc launchSwarm(port: TPort) {.async.} =
   for i in 0 .. <swarmSize:
-    var sock = newAsyncRawSocket()
+    var sock = newAsyncNativeSocket()
 
     await connect(sock, "localhost", port)
     await sendMessages(sock)
@@ -38,7 +38,7 @@ proc readMessages(client: TAsyncFD) {.async.} =
         doAssert false
 
 proc createServer(port: TPort) {.async.} =
-  var server = newAsyncRawSocket()
+  var server = newAsyncNativeSocket()
   block:
     var name: Sockaddr_in
     when defined(windows):
diff --git a/tests/async/tasyncconnect.nim b/tests/async/tasyncconnect.nim
index b27a810b8..3dac379b2 100644
--- a/tests/async/tasyncconnect.nim
+++ b/tests/async/tasyncconnect.nim
@@ -19,7 +19,7 @@ when defined(windows) or defined(nimdoc):
     quit("Error: unhandled exception: Connection refused")
 else:
     proc testAsyncConnect() {.async.} =
-        var s = newAsyncRawSocket()
+        var s = newAsyncNativeSocket()
 
         await s.connect(testHost, testPort)
 
diff --git a/tests/async/tasynceverror.nim b/tests/async/tasynceverror.nim
index 2f570344f..22b4fe9a7 100644
--- a/tests/async/tasynceverror.nim
+++ b/tests/async/tasynceverror.nim
@@ -7,7 +7,7 @@ discard """
 import
     asyncdispatch,
     asyncnet,
-    rawsockets,
+    nativesockets,
     os
 
 
@@ -21,7 +21,7 @@ when defined(windows) or defined(nimdoc):
     quit("Error: unhandled exception: Connection reset by peer")
 else:
     proc createListenSocket(host: string, port: Port): TAsyncFD =
-        result = newAsyncRawSocket()
+        result = newAsyncNativeSocket()
 
         SocketHandle(result).setSockOptInt(SOL_SOCKET, SO_REUSEADDR, 1)
 
diff --git a/tests/cpp/trawsockets.nim b/tests/cpp/tnativesockets.nim
index bc129de57..6108380a8 100644
--- a/tests/cpp/trawsockets.nim
+++ b/tests/cpp/tnativesockets.nim
@@ -2,4 +2,4 @@ discard """
   cmd: "nim cpp $file"
 """
 
-import rawsockets
+import nativesockets
diff --git a/tests/macros/tgensym.nim b/tests/macros/tgensym.nim
index b3aef0a2c..a4d1a3606 100644
--- a/tests/macros/tgensym.nim
+++ b/tests/macros/tgensym.nim
@@ -1,6 +1,6 @@
-import rawsockets, asyncdispatch, macros
+import nativesockets, asyncdispatch, macros
 var p = newDispatcher()
-var sock = newAsyncRawSocket()
+var sock = newAsyncNativeSocket()
 
 proc convertReturns(node, retFutureSym: NimNode): NimNode {.compileTime.} =
   case node.kind
diff --git a/tests/modules/texport.nim b/tests/modules/texport.nim
index 0890fb369..a8c217ab8 100644
--- a/tests/modules/texport.nim
+++ b/tests/modules/texport.nim
@@ -5,7 +5,7 @@ discard """
 import mexporta
 
 # bug #1029:
-from rawsockets import accept
+from nativesockets import accept
 
 # B.TMyObject has been imported implicitly here:
 var x: TMyObject