• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 #ifndef _U_NETWORK_H_
3 #define _U_NETWORK_H_
4 
5 #include "pipe/p_compiler.h"
6 
7 #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
8 #  define PIPE_HAVE_SOCKETS
9 #elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || \
10     defined(PIPE_OS_APPLE) || defined(PIPE_OS_SOLARIS)
11 #  define PIPE_HAVE_SOCKETS
12 #endif
13 
14 boolean u_socket_init(void);
15 void u_socket_stop(void);
16 void u_socket_close(int s);
17 int u_socket_listen_on_port(uint16_t portnum);
18 int u_socket_accept(int s);
19 int u_socket_connect(const char *host, uint16_t port);
20 int u_socket_send(int s, void *data, size_t size);
21 int u_socket_peek(int s, void *data, size_t size);
22 int u_socket_recv(int s, void *data, size_t size);
23 void u_socket_block(int s, boolean block);
24 
25 #endif
26