Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add server to ipc_helper

  • Loading branch information...
ry committed Sep 29, 2011
1 parent 32151d5 commit 73047abb19343e96f2929796becb23c1031c91f5
Showing with 16 additions and 0 deletions.
  1. +16 −0 test/run-tests.c
@@ -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
@@ -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);

0 comments on commit 73047ab

Please sign in to comment.
You can’t perform that action at this time.