summaryrefslogtreecommitdiff
path: root/deps/uv/test/echo-server.c
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-07-01 09:30:44 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-07-01 09:30:44 -0700
commit412e413edc3864cf2d6da30b88248c0cbbe4e941 (patch)
treea8e55dfe2a8fce09614074162a08bf9e8ed20d74 /deps/uv/test/echo-server.c
parent4c480551c3cc0b6f10ebe4c033580b3a3c148550 (diff)
downloadnode-new-412e413edc3864cf2d6da30b88248c0cbbe4e941.tar.gz
Upgrade libuv
Diffstat (limited to 'deps/uv/test/echo-server.c')
-rw-r--r--deps/uv/test/echo-server.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/deps/uv/test/echo-server.c b/deps/uv/test/echo-server.c
index a3f8f29ed1..1243a9a489 100644
--- a/deps/uv/test/echo-server.c
+++ b/deps/uv/test/echo-server.c
@@ -36,10 +36,10 @@ static uv_tcp_t server;
static void after_write(uv_req_t* req, int status);
-static void after_read(uv_tcp_t*, ssize_t nread, uv_buf_t buf);
+static void after_read(uv_stream_t*, ssize_t nread, uv_buf_t buf);
static void on_close(uv_handle_t* peer);
static void on_server_close(uv_handle_t* handle);
-static void on_connection(uv_tcp_t*, int status);
+static void on_connection(uv_handle_t*, int status);
static void after_write(uv_req_t* req, int status) {
@@ -65,7 +65,7 @@ static void after_shutdown(uv_req_t* req, int status) {
}
-static void after_read(uv_tcp_t* handle, ssize_t nread, uv_buf_t buf) {
+static void after_read(uv_stream_t* handle, ssize_t nread, uv_buf_t buf) {
int i;
write_req_t *wr;
uv_req_t* req;
@@ -117,7 +117,7 @@ static void on_close(uv_handle_t* peer) {
}
-static uv_buf_t echo_alloc(uv_tcp_t* handle, size_t suggested_size) {
+static uv_buf_t echo_alloc(uv_stream_t* handle, size_t suggested_size) {
uv_buf_t buf;
buf.base = (char*) malloc(suggested_size);
buf.len = suggested_size;
@@ -125,7 +125,7 @@ static uv_buf_t echo_alloc(uv_tcp_t* handle, size_t suggested_size) {
}
-static void on_connection(uv_tcp_t* server, int status) {
+static void on_connection(uv_handle_t* server, int status) {
uv_tcp_t* handle;
int r;
@@ -136,10 +136,10 @@ static void on_connection(uv_tcp_t* server, int status) {
uv_tcp_init(handle);
- r = uv_accept(server, handle);
+ r = uv_accept(server, (uv_stream_t*)handle);
ASSERT(r == 0);
- r = uv_read_start(handle, echo_alloc, after_read);
+ r = uv_read_start((uv_stream_t*)handle, echo_alloc, after_read);
ASSERT(r == 0);
}
@@ -160,14 +160,14 @@ static int echo_start(int port) {
return 1;
}
- r = uv_bind(&server, addr);
+ r = uv_tcp_bind(&server, addr);
if (r) {
/* TODO: Error codes */
fprintf(stderr, "Bind error\n");
return 1;
}
- r = uv_listen(&server, 128, on_connection);
+ r = uv_tcp_listen(&server, 128, on_connection);
if (r) {
/* TODO: Error codes */
fprintf(stderr, "Listen error\n");