Example #1
0
int uv_accept(uv_stream_t* server, uv_stream_t* client) {
    switch (server->type) {
    case UV_TCP:
        return uv_tcp_accept((uv_tcp_t*)server, (uv_tcp_t*)client);
    case UV_NAMED_PIPE:
        return uv_pipe_accept((uv_pipe_t*)server, client);
    default:
        assert(0);
        return -1;
    }
}
Example #2
0
int uv_accept(uv_stream_t* server, uv_stream_t* client) {
  int err;

  err = ERROR_INVALID_PARAMETER;
  switch (server->type) {
    case UV_TCP:
      err = uv_tcp_accept((uv_tcp_t*)server, (uv_tcp_t*)client);
      break;
    case UV_NAMED_PIPE:
      err = uv_pipe_accept((uv_pipe_t*)server, client);
      break;
    default:
      assert(0);
  }

  return uv_translate_sys_error(err);
}