socket.h
Go to the documentation of this file.
1 #ifndef NVIM_EVENT_SOCKET_H
2 #define NVIM_EVENT_SOCKET_H
3 
4 #include <uv.h>
5 
6 #include "nvim/event/loop.h"
7 #include "nvim/event/rstream.h"
8 #include "nvim/event/wstream.h"
9 
10 #define ADDRESS_MAX_SIZE 256
11 
13 typedef void (*socket_cb)(SocketWatcher *watcher, int result, void *data);
14 typedef void (*socket_close_cb)(SocketWatcher *watcher, void *data);
15 
17  // Pipe/socket path, or TCP address string
19  // TCP server or unix socket (named pipe on Windows)
20  union {
21  struct {
22  uv_tcp_t handle;
23  struct addrinfo *addrinfo;
24  } tcp;
25  struct {
26  uv_pipe_t handle;
27  } pipe;
28  } uv;
29  uv_stream_t *stream;
30  void *data;
34 };
35 
36 #ifdef INCLUDE_GENERATED_DECLARATIONS
37 # include "event/socket.h.generated.h"
38 #endif
39 #endif // NVIM_EVENT_SOCKET_H
struct socket_watcher::@17::@19 pipe
#define ADDRESS_MAX_SIZE
Definition: socket.h:10
void(* socket_cb)(SocketWatcher *watcher, int result, void *data)
Definition: socket.h:13
socket_cb cb
Definition: socket.h:31
uv_stream_t * stream
Definition: socket.h:29
MultiQueue * events
Definition: socket.h:33
char addr[ADDRESS_MAX_SIZE]
Definition: socket.h:18
union socket_watcher::@17 uv
void(* socket_close_cb)(SocketWatcher *watcher, void *data)
Definition: socket.h:14
uv_pipe_t handle
Definition: socket.h:26
struct socket_watcher::@17::@18 tcp
socket_close_cb close_cb
Definition: socket.h:32
void * data
Definition: socket.h:30
Definition: socket.h:16
struct addrinfo * addrinfo
Definition: socket.h:23
uv_tcp_t handle
Definition: socket.h:22
Definition: multiqueue.c:73