Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5bd6f99
add net test file, with one test group (connection)
natevw Jul 25, 2014
5de68a7
extend net tests to include server, IP format checking
natevw Jul 25, 2014
94af33c
gracefully handle bogus IP candidates
natevw Jul 25, 2014
06a1865
properly factor into IPv4/6/either methods
natevw Jul 25, 2014
2986cd9
get most IPv6 and IPv6 tests passing via StackOverflow regexes. unfor…
natevw Jul 25, 2014
c534790
"fix" the IPv6 regex ;-)
natevw Jul 25, 2014
6694a21
move IP address and misc. helpers out from middle of TCPSocket code
natevw Jul 28, 2014
2127273
close socket when stream finished, fire end event whenever __listen l…
natevw Jul 28, 2014
2442905
temporary workaround for https://github.com/tessel/runtime/issues/311
natevw Jul 28, 2014
8157595
net.Server should emit 'connection', not 'socket', events
natevw Jul 28, 2014
0356a79
have net.Server emit listen event, handle optional arguments to .list…
natevw Jul 29, 2014
ee266e9
actually register listening cb, fire event async so sync-registered l…
natevw Jul 29, 2014
b6b0c68
basic JS-side automatic port binding. does not handle potential confl…
natevw Jul 30, 2014
dd2fed5
don't throw on listen error, fixes #332
natevw Jul 30, 2014
8082d81
adds a test for port binding behavior, fixes #331
natevw Jul 30, 2014
719d4c6
avoid throwing and emit errors instead (except for two usage asserts)…
natevw Jul 30, 2014
e1f5163
fix whitespace
natevw Jul 30, 2014
53d284e
stop server from continued polling after socket is closed, fixes #333
natevw Jul 30, 2014
fb0204c
default host when connecting, fixes #311
natevw Jul 30, 2014
c378002
implement net.Socket.prototype.setTimeout
natevw Jul 31, 2014
68b0d12
add warning and note about setNoDelay
natevw Jul 31, 2014
0377896
handle options to createServer, warn if allowHalfOpen requested
natevw Jul 31, 2014
5faf6dd
handle options to createServer, warn if allowHalfOpen requested
natevw Jul 31, 2014
b489d34
[caution: tm_net change will need mirroring in firmware] basic pass a…
natevw Jul 31, 2014
e416432
use tinytap which is the only small test runner that "works", https:/…
natevw Aug 5, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"bindings": "~1.2.0"
},
"devDependencies": {
"tap": "git+https://github.com/tcr/node-tap.git#4f96b1",
"tape": "~2.3.2",
"tap": "git+https://github.com/tcr/node-tap.git#4f96b1"
"tinytap": "^0.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add ttt as a dependency? Should be version 1.0.3. Without it the Travis tests fail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, the ttt changes got merged into tiny tap

}
}
15 changes: 7 additions & 8 deletions src/colony/lua_tm.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,10 @@ static int l_tm_tcp_close (lua_State* L)
static int l_tm_tcp_connect (lua_State* L)
{
tm_socket_t socket = (tm_socket_t) lua_tonumber(L, 1);
uint8_t ip0 = (uint8_t) lua_tonumber(L, 2);
uint8_t ip1 = (uint8_t) lua_tonumber(L, 3);
uint8_t ip2 = (uint8_t) lua_tonumber(L, 4);
uint8_t ip3 = (uint8_t) lua_tonumber(L, 5);
uint16_t port = (uint16_t) lua_tonumber(L, 6);
uint32_t addr = (uint32_t) lua_tonumber(L, 2);
uint16_t port = (uint16_t) lua_tonumber(L, 3);

lua_pushnumber(L, tm_tcp_connect(socket, ip0, ip1, ip2, ip3, port));
lua_pushnumber(L, tm_tcp_connect(socket, addr, port));
return 1;
}

Expand Down Expand Up @@ -247,11 +244,13 @@ static int l_tm_tcp_listen (lua_State* L)
static int l_tm_tcp_accept (lua_State* L)
{
uint32_t addr;
uint16_t port;
tm_socket_t socket = (tm_socket_t) lua_tonumber(L, 1);

lua_pushnumber(L, tm_tcp_accept(socket, &addr));
lua_pushnumber(L, tm_tcp_accept(socket, &addr, &port));
lua_pushnumber(L, addr);
return 2;
lua_pushnumber(L, port);
return 3;
}

#ifdef ENABLE_TLS
Expand Down
Loading