Skip to content
This repository
Browse code

Rename uv_platform_socket_t to uv_os_sock_t

  • Loading branch information...
commit 542eb24f3c1f18246da7538781c296667320174d 1 parent 918d23f
Bert Belder authored May 03, 2012
2  include/uv-private/uv-unix.h
@@ -45,7 +45,7 @@ typedef struct {
45 45
 
46 46
 typedef int uv_file;
47 47
 
48  
-typedef int uv_platform_socket_t;
  48
+typedef int uv_os_sock_t;
49 49
 
50 50
 #define UV_ONCE_INIT PTHREAD_ONCE_INIT
51 51
 
2  include/uv-private/uv-win.h
@@ -160,7 +160,7 @@ typedef struct uv_buf_t {
160 160
 
161 161
 typedef int uv_file;
162 162
 
163  
-typedef SOCKET uv_platform_socket_t;
  163
+typedef SOCKET uv_os_sock_t;
164 164
 
165 165
 typedef HANDLE uv_thread_t;
166 166
 
2  include/uv.h
@@ -975,7 +975,7 @@ UV_EXTERN int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd);
975 975
 /* Initialize the poll watcher using a socket descriptor. On unix this is */
976 976
 /* identical to uv_poll_init. On windows it takes a SOCKET handle. */
977 977
 UV_EXTERN int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle,
978  
-    uv_platform_socket_t socket);
  978
+    uv_os_sock_t socket);
979 979
 
980 980
 /*
981 981
  * Starts polling the file descriptor. `events` is a bitmask consisting made up
2  src/unix/poll.c
@@ -68,7 +68,7 @@ int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd) {
68 68
 
69 69
 
70 70
 int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle,
71  
-    uv_platform_socket_t socket) {
  71
+    uv_os_sock_t socket) {
72 72
   return uv_poll_init(loop, handle, socket);
73 73
 }
74 74
 
2  src/win/poll.c
@@ -474,7 +474,7 @@ int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd) {
474 474
 
475 475
 
476 476
 int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle,
477  
-    uv_platform_socket_t socket) {
  477
+    uv_os_sock_t socket) {
478 478
   WSAPROTOCOL_INFOW protocol_info;
479 479
   int len;
480 480
   SOCKET peer_socket, base_socket;
22  test/test-poll.c
@@ -46,7 +46,7 @@ typedef enum {
46 46
 typedef struct connection_context_s {
47 47
   uv_poll_t poll_handle;
48 48
   uv_timer_t timer_handle;
49  
-  uv_platform_socket_t sock;
  49
+  uv_os_sock_t sock;
50 50
   size_t read, sent;
51 51
   int is_server_connection;
52 52
   int open_handles;
@@ -56,7 +56,7 @@ typedef struct connection_context_s {
56 56
 
57 57
 typedef struct server_context_s {
58 58
   uv_poll_t poll_handle;
59  
-  uv_platform_socket_t sock;
  59
+  uv_os_sock_t sock;
60 60
   int connections;
61 61
 } server_context_t;
62 62
 
@@ -86,7 +86,7 @@ static int got_eagain() {
86 86
 }
87 87
 
88 88
 
89  
-static void set_nonblocking(uv_platform_socket_t sock) {
  89
+static void set_nonblocking(uv_os_sock_t sock) {
90 90
   int r;
91 91
 #ifdef _WIN32
92 92
   unsigned long on = 1;
@@ -101,9 +101,9 @@ static void set_nonblocking(uv_platform_socket_t sock) {
101 101
 }
102 102
 
103 103
 
104  
-static uv_platform_socket_t create_nonblocking_bound_socket(
  104
+static uv_os_sock_t create_nonblocking_bound_socket(
105 105
     struct sockaddr_in bind_addr) {
106  
-  uv_platform_socket_t sock;
  106
+  uv_os_sock_t sock;
107 107
   int r;
108 108
 
109 109
   sock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
@@ -131,7 +131,7 @@ static uv_platform_socket_t create_nonblocking_bound_socket(
131 131
 }
132 132
 
133 133
 
134  
-static void close_socket(uv_platform_socket_t sock) {
  134
+static void close_socket(uv_os_sock_t sock) {
135 135
   int r;
136 136
 #ifdef _WIN32
137 137
   r = closesocket(sock);
@@ -143,7 +143,7 @@ static void close_socket(uv_platform_socket_t sock) {
143 143
 
144 144
 
145 145
 static connection_context_t* create_connection_context(
146  
-    uv_platform_socket_t sock, int is_server_connection) {
  146
+    uv_os_sock_t sock, int is_server_connection) {
147 147
   int r;
148 148
   connection_context_t* context;
149 149
 
@@ -433,7 +433,7 @@ static void delay_timer_cb(uv_timer_t* timer, int status) {
433 433
 
434 434
 
435 435
 static server_context_t* create_server_context(
436  
-    uv_platform_socket_t sock) {
  436
+    uv_os_sock_t sock) {
437 437
   int r;
438 438
   server_context_t* context;
439 439
 
@@ -468,7 +468,7 @@ static void server_poll_cb(uv_poll_t* handle, int status, int events) {
468 468
   connection_context_t* connection_context;
469 469
   struct sockaddr_in addr;
470 470
   socklen_t addr_len;
471  
-  uv_platform_socket_t sock;
  471
+  uv_os_sock_t sock;
472 472
   int r;
473 473
 
474 474
   addr_len = sizeof addr;
@@ -496,7 +496,7 @@ static void server_poll_cb(uv_poll_t* handle, int status, int events) {
496 496
 
497 497
 
498 498
 static void start_server() {
499  
-  uv_platform_socket_t sock;
  499
+  uv_os_sock_t sock;
500 500
   server_context_t* context;
501 501
   int r;
502 502
 
@@ -512,7 +512,7 @@ static void start_server() {
512 512
 
513 513
 
514 514
 static void start_client() {
515  
-  uv_platform_socket_t sock;
  515
+  uv_os_sock_t sock;
516 516
   connection_context_t* context;
517 517
   struct sockaddr_in server_addr = uv_ip4_addr("127.0.0.1", TEST_PORT);
518 518
   int r;

0 notes on commit 542eb24

Please sign in to comment.
Something went wrong with that request. Please try again.