QNet/include/qnet/server.h

24 lines
No EOL
821 B
C

/*
* Copyright (C) Tristan Franssen, <tristanfranssen@strawhats.nl>.
*
* This software is licensed under the Apache License, Version 2.0 (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License in the file LICENSE or at
* http://www.apache.org/licenses/LICENSE-2.0
*/
#ifndef QNET_SERVER
#define QNET_SERVER
#include "qnet/network.h"
typedef enum {
QNET_SERVER_ERROR_OK = 0,
QNET_SERVER_ERROR_FAILED_TO_CREATE_SOCKET = -1,
QNET_SERVER_ERROR_INVALID_ADDRESS = -2,
QNET_SERVER_ERROR_FAILED_TO_BIND_ADDRESS = -3
} QNetServerError;
QNetServerError qnet_server_tcp_bind(qnet_socket_type *server_socket, struct sockaddr *address);
QNetServerError qnet_server_udp_bind(qnet_socket_type *server_socket, struct sockaddr *address);
#endif