net.h (755B)
1 /* net.h - cliente de red (servidor VPS o host LAN). Protocolo: comun/server/srv.h y server/server.h. */ 2 #ifndef NET_H 3 #define NET_H 4 5 #include "session.h" 6 #include "netline.h" 7 8 struct Server; 9 10 Net *net_connect(const char *host, int port, const char *name, struct Server *embedded, char *err, int errlen); 11 bool net_send(Net *n, const char *fmt, ...); 12 bool net_read_line(Net *n, char *line, int len, int timeout_ms); /* bloqueante (menus) */ 13 /* Espera GAME + historial hasta SYNC y deja la sesion lista. */ 14 bool net_enter_game(Net *n, Session *s, char *err, int errlen); 15 const char *net_code(Net *n); 16 int net_submit(Net *n, Act *a); 17 void net_poll(Net *n); 18 int net_fds(Net *n, int *fds, int max); 19 int net_timeout(Net *n); 20 void net_close(Net *n); 21 22 #endif