Merge remote-tracking branch 'nim-lang/devel' into emscripten-support
This commit is contained in:
commit
d1b67cb9bb
39 changed files with 294 additions and 133 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@ discard """
|
|||
cmd: "nim cpp $file"
|
||||
"""
|
||||
|
||||
import rawsockets
|
||||
import nativesockets
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -213,6 +213,8 @@ proc compilerOutputTests(test: TTest, given: var TSpec, expected: TSpec;
|
|||
expectedmsg = expected.nimout
|
||||
givenmsg = given.nimout.strip
|
||||
nimoutCheck(test, expectedmsg, given)
|
||||
else:
|
||||
givenmsg = given.nimout.strip
|
||||
if given.err == reSuccess: inc(r.passed)
|
||||
r.addResult(test, expectedmsg, givenmsg, given.err)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue