PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/src/network/server.h

https://bitbucket.org/vivkin/gam3b00bs/
C++ Header | 17 lines | 12 code | 5 blank | 0 comment | 0 complexity | 60667335df2f34c39fd01ab0afbf3fe3 MD5 | raw file
 1#pragma once
 2
 3namespace network
 4{
 5	struct server;
 6	struct client;
 7	
 8	typedef bool (*network_callback)();
 9
10	server* server_create(const char* bind_host, uint16_t bind_port, uint8_t clients = 4, uint8_t channels = 1);
11	void server_destroy(server* serv);
12
13	void server_poll(server* serv, network_callback callback);
14
15	size_t server_replicate_data(server* serv, uint8_t channel, const void* data, size_t size);
16	size_t server_send_data(server* serv, client* cl, uint8_t channel, const void* data, size_t size);
17}