diff --git a/make.ps1 b/make.ps1 index 56ef414571..35567c502c 100644 --- a/make.ps1 +++ b/make.ps1 @@ -33,7 +33,7 @@ [Parameter(HelpMessage="Tests to run")] [string] - $TestsToRun = 'libponyrt.tests,libponyc.tests,libponyc.run.tests.debug,libponyc.run.tests.release,stdlib-debug,stdlib-release,grammar' + $TestsToRun = 'stdlib-debug,stdlib-release' ) $srcDir = Split-Path $script:MyInvocation.MyCommand.Path diff --git a/packages/net/_test.pony b/packages/net/_test.pony index 995c2a31a1..f17fc2dd6a 100644 --- a/packages/net/_test.pony +++ b/packages/net/_test.pony @@ -9,11 +9,11 @@ actor \nodoc\ Main is TestList // Tests below function across all systems and are listed alphabetically test(_TestTCPConnectionFailed) test(_TestTCPExpect) - // test(_TestTCPExpectOverBufferSize) + test(_TestTCPExpectOverBufferSize) test(_TestTCPMute) - // test(_TestTCPProxy) + test(_TestTCPProxy) test(_TestTCPUnmute) - // test(_TestTCPWritev) + test(_TestTCPWritev) // Tests below exclude windows and are listed alphabetically ifdef not windows then @@ -22,9 +22,9 @@ actor \nodoc\ Main is TestList end // Tests below exclude osx and are listed alphabetically - /*ifdef not osx then + ifdef not osx then test(_TestBroadcast) - end*/ + end class \nodoc\ _TestPing is UDPNotify let _h: TestHelper @@ -134,7 +134,7 @@ class \nodoc\ iso _TestBroadcast is UnitTest h.dispose_when_done( UDPSocket(UDPAuth(h.env.root), recover _TestPong(h) end)) - h.long_test(300_000_000_000) + h.long_test(30_000_000_000) fun ref timed_out(h: TestHelper) => h.log(""" @@ -168,7 +168,7 @@ class \nodoc\ _TestTCP is TCPListenNotify h.dispose_when_done(TCPListener.ip4(TCPListenAuth(h.env.root), consume this, "127.0.0.1", port)) h.complete_action("server create") - h.long_test(300_000_000_000) + h.long_test(30_000_000_000) fun ref not_listening(listen: TCPListener ref) => _h.fail_action("server listen") @@ -247,7 +247,7 @@ class \nodoc\ _TestTCPExpectNotify is TCPConnectionNotify fun ref accepted(conn: TCPConnection ref) => @printf("connection accepted by _TestTCPExpectNotify %p\n".cstring(), conn) - //conn.set_nodelay(true) + conn.set_nodelay(true) try conn.expect(_expect)? _send(conn, "hi there") @@ -260,7 +260,7 @@ class \nodoc\ _TestTCPExpectNotify is TCPConnectionNotify fun ref connected(conn: TCPConnection ref) => _h.complete_action("client connect") - //conn.set_nodelay(true) + conn.set_nodelay(true) try conn.expect(_expect)? else @@ -333,7 +333,7 @@ class \nodoc\ _TestTCPExpectOverBufferSizeNotify is TCPConnectionNotify fun ref accepted(conn: TCPConnection ref) => @printf("connection accepted by _TestTCPExpectOverBufferSizeNotify %p\n".cstring(), conn) - //conn.set_nodelay(true) + conn.set_nodelay(true) try conn.expect(_expect)? _h.fail("expect didn't error out") @@ -343,7 +343,7 @@ class \nodoc\ _TestTCPExpectOverBufferSizeNotify is TCPConnectionNotify fun ref connected(conn: TCPConnection ref) => _h.complete_action("client connect") - //conn.set_nodelay(true) + conn.set_nodelay(true) try conn.expect(_expect)? _h.fail("expect didn't error out") @@ -713,7 +713,7 @@ class \nodoc\ _TestTCPConnectionFailed is UnitTest end, host, port) - h.long_test(300_000_000_000) + h.long_test(30_000_000_000) h.dispose_when_done(connection) class \nodoc\ _TestTCPConnectionToClosedServerFailed is UnitTest @@ -760,7 +760,7 @@ class \nodoc\ _TestTCPConnectionToClosedServerFailed is UnitTest ) h.dispose_when_done(listener) - h.long_test(300_000_000_000) + h.long_test(30_000_000_000) actor \nodoc\ _TCPConnectionToClosedServerFailedConnector be connect(h: TestHelper, host: String, port: String) => diff --git a/packages/net/tcp_connection.pony b/packages/net/tcp_connection.pony index fc5f2f1852..7f7f1b3a2c 100644 --- a/packages/net/tcp_connection.pony +++ b/packages/net/tcp_connection.pony @@ -1139,8 +1139,6 @@ actor TCPConnection is AsioEventNotify // On windows, this will also cancel all outstanding IOCP operations. @printf("%p closing socket %d\n".cstring(), this, _fd) @pony_os_socket_close(_fd) - // TODO SEAN - @pony_os_socket_shutdown(_fd) _fd = -1 _notify.closed(this) diff --git a/src/libponyrt/lang/socket.c b/src/libponyrt/lang/socket.c index 4aeb363c75..f9556f6b08 100644 --- a/src/libponyrt/lang/socket.c +++ b/src/libponyrt/lang/socket.c @@ -1132,18 +1132,8 @@ PONY_API void pony_os_socket_shutdown(int fd) PONY_API void pony_os_socket_close(int fd) { #ifdef PLATFORM_IS_WINDOWS - if (CancelIoEx((HANDLE)(UINT_PTR)fd, NULL) == 0) { - printf("CancelIoEx failed\n"); - printf("pony os socket close error: %ld\n", GetLastError()); - } else { - printf("CancelIOEx good\n"); - } - printf("closing socket %d\n", fd); - if (closesocket((SOCKET)fd) != 0) { - printf("close socket error: %ld\n", WSAGetLastError()); - } else { - printf("close socket good\n"); - } + CancelIoEx((HANDLE)(UINT_PTR)fd, NULL); + closesocket((SOCKET)fd); #else close(fd); #endif