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

Commit

Permalink
Rename uv_platform_socket_t to uv_os_sock_t
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed May 3, 2012
1 parent 918d23f commit 542eb24
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion include/uv-private/uv-unix.h
Expand Up @@ -45,7 +45,7 @@ typedef struct {

typedef int uv_file;

typedef int uv_platform_socket_t;
typedef int uv_os_sock_t;

#define UV_ONCE_INIT PTHREAD_ONCE_INIT

Expand Down
2 changes: 1 addition & 1 deletion include/uv-private/uv-win.h
Expand Up @@ -160,7 +160,7 @@ typedef struct uv_buf_t {

typedef int uv_file;

typedef SOCKET uv_platform_socket_t;
typedef SOCKET uv_os_sock_t;

typedef HANDLE uv_thread_t;

Expand Down
2 changes: 1 addition & 1 deletion include/uv.h
Expand Up @@ -975,7 +975,7 @@ UV_EXTERN int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd);
/* Initialize the poll watcher using a socket descriptor. On unix this is */
/* identical to uv_poll_init. On windows it takes a SOCKET handle. */
UV_EXTERN int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle,
uv_platform_socket_t socket);
uv_os_sock_t socket);

/*
* Starts polling the file descriptor. `events` is a bitmask consisting made up
Expand Down
2 changes: 1 addition & 1 deletion src/unix/poll.c
Expand Up @@ -68,7 +68,7 @@ int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd) {


int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle,
uv_platform_socket_t socket) {
uv_os_sock_t socket) {
return uv_poll_init(loop, handle, socket);
}

Expand Down
2 changes: 1 addition & 1 deletion src/win/poll.c
Expand Up @@ -474,7 +474,7 @@ int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd) {


int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle,
uv_platform_socket_t socket) {
uv_os_sock_t socket) {
WSAPROTOCOL_INFOW protocol_info;
int len;
SOCKET peer_socket, base_socket;
Expand Down
22 changes: 11 additions & 11 deletions test/test-poll.c
Expand Up @@ -46,7 +46,7 @@ typedef enum {
typedef struct connection_context_s {
uv_poll_t poll_handle;
uv_timer_t timer_handle;
uv_platform_socket_t sock;
uv_os_sock_t sock;
size_t read, sent;
int is_server_connection;
int open_handles;
Expand All @@ -56,7 +56,7 @@ typedef struct connection_context_s {

typedef struct server_context_s {
uv_poll_t poll_handle;
uv_platform_socket_t sock;
uv_os_sock_t sock;
int connections;
} server_context_t;

Expand Down Expand Up @@ -86,7 +86,7 @@ static int got_eagain() {
}


static void set_nonblocking(uv_platform_socket_t sock) {
static void set_nonblocking(uv_os_sock_t sock) {
int r;
#ifdef _WIN32
unsigned long on = 1;
Expand All @@ -101,9 +101,9 @@ static void set_nonblocking(uv_platform_socket_t sock) {
}


static uv_platform_socket_t create_nonblocking_bound_socket(
static uv_os_sock_t create_nonblocking_bound_socket(
struct sockaddr_in bind_addr) {
uv_platform_socket_t sock;
uv_os_sock_t sock;
int r;

sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
Expand Down Expand Up @@ -131,7 +131,7 @@ static uv_platform_socket_t create_nonblocking_bound_socket(
}


static void close_socket(uv_platform_socket_t sock) {
static void close_socket(uv_os_sock_t sock) {
int r;
#ifdef _WIN32
r = closesocket(sock);
Expand All @@ -143,7 +143,7 @@ static void close_socket(uv_platform_socket_t sock) {


static connection_context_t* create_connection_context(
uv_platform_socket_t sock, int is_server_connection) {
uv_os_sock_t sock, int is_server_connection) {
int r;
connection_context_t* context;

Expand Down Expand Up @@ -433,7 +433,7 @@ static void delay_timer_cb(uv_timer_t* timer, int status) {


static server_context_t* create_server_context(
uv_platform_socket_t sock) {
uv_os_sock_t sock) {
int r;
server_context_t* context;

Expand Down Expand Up @@ -468,7 +468,7 @@ static void server_poll_cb(uv_poll_t* handle, int status, int events) {
connection_context_t* connection_context;
struct sockaddr_in addr;
socklen_t addr_len;
uv_platform_socket_t sock;
uv_os_sock_t sock;
int r;

addr_len = sizeof addr;
Expand Down Expand Up @@ -496,7 +496,7 @@ static void server_poll_cb(uv_poll_t* handle, int status, int events) {


static void start_server() {
uv_platform_socket_t sock;
uv_os_sock_t sock;
server_context_t* context;
int r;

Expand All @@ -512,7 +512,7 @@ static void start_server() {


static void start_client() {
uv_platform_socket_t sock;
uv_os_sock_t sock;
connection_context_t* context;
struct sockaddr_in server_addr = uv_ip4_addr("127.0.0.1", TEST_PORT);
int r;
Expand Down

0 comments on commit 542eb24

Please sign in to comment.