Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Add server to ipc_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Sep 29, 2011
1 parent 32151d5 commit 73047ab
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/run-tests.c
Expand Up @@ -49,6 +49,13 @@ int main(int argc, char **argv) {
}


static uv_tcp_t server;


static void ipc_on_connection(uv_stream_t* server, int status) {
}


static int ipc_helper() {
/*
* This is launched from test-ipc.c. stdin is a duplex channel that we
Expand All @@ -66,6 +73,15 @@ static int ipc_helper() {

uv_pipe_open(&channel, 0);

r = uv_tcp_init(uv_default_loop(), &server);
ASSERT(r == 0);

r = uv_tcp_bind(&server, uv_ip4_addr("0.0.0.0", TEST_PORT));
ASSERT(r == 0);

r = uv_listen((uv_stream_t*)&server, 12, ipc_on_connection);
ASSERT(r == 0);

buf = uv_buf_init("hello\n", 6);
r = uv_write(&write_req, (uv_stream_t*)&channel, &buf, 1, NULL);
ASSERT(r == 0);
Expand Down

0 comments on commit 73047ab

Please sign in to comment.