Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * networking.h
- *
- * Created on: Jul 18, 2019
- * Author: practica
- */
- #ifndef NETWORKING_H_
- #define NETWORKING_H_
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define MAX_SERVER_NAME 20
- enum ServerStatus {
- Idle,
- WaitToStart,
- Running
- };
- /**
- *
- */
- struct Server {
- int ID;
- int IP;
- enum ServerStatus status;
- char name[MAX_SERVER_NAME];
- unsigned short tcpPort;
- };
- struct Server Date[5];
- int server_count;
- struct ServerInfo {
- int ID;
- enum ServerStatus status;
- char name[MAX_SERVER_NAME];
- unsigned short tcpPort;
- };
- void notify(char message[50], int length); //notificare primire date
- void start_server(int ID);
- int stop_accepting_clients();
- void register_cb_new_user();
- void register_cb_notify();
- void request_turn(int ID);
- void send_status(char *data_buffer,int length);
- /**
- * Get a list of at most \p max_len discovered servers.
- *
- * @param [OUT]srvList
- * @param max_len maximum number of servers
- * @return the count (negative for error)
- */
- int listServers(struct ServerInfo *srvList, int max_len);
- #ifdef __cplusplus
- }
- #endif
- #endif /* NETWORKING_H_*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement