complete rewrite
This commit is contained in:
parent
b60e3a0ef6
commit
8a717a2b2e
41 changed files with 2625 additions and 1255 deletions
18
engine/net/testserver.c
Normal file
18
engine/net/testserver.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <fishsoup.h>
|
||||
|
||||
void on(fishsoup_server_t* server, fishsoup_client_t* client) {
|
||||
fishsoup_packet_t pkt;
|
||||
|
||||
pkt.data = "Hello world!";
|
||||
pkt.header.length = strlen(pkt.data) + 1;
|
||||
pkt.header.flag = 0;
|
||||
pkt.header.type = FISHSOUP_PACKET_USER;
|
||||
|
||||
fishsoup_packet_send(client->fd, &pkt);
|
||||
}
|
||||
|
||||
int main() {
|
||||
fishsoup_server_t* server = fishsoup_server(0);
|
||||
fishsoup_server_on_client(server, on);
|
||||
fishsoup_server_loop(server);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue