endpoint: server: Add server creation logic
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
@@ -9,4 +9,10 @@
|
||||
/* Server software version */
|
||||
#define SERVER_VERSION "0.0.1"
|
||||
|
||||
/* Server listen port */
|
||||
#define SERVER_PORT 717
|
||||
|
||||
/* Server listen backlog */
|
||||
#define SERVER_BACKLOG 16
|
||||
|
||||
#endif /* !ENDPOINT_COMMON_H */
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2026, Chloe Moffett
|
||||
* Provided under the BSD-3 clause
|
||||
*/
|
||||
|
||||
#ifndef ENDPOINT_SERVER_H
|
||||
#define ENDPOINT_SERVER_H 1
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/*
|
||||
* Represents the endpoint server state
|
||||
*
|
||||
* @sockfd: Socket file descriptor
|
||||
*/
|
||||
struct endpoint_server {
|
||||
int sockfd;
|
||||
};
|
||||
|
||||
/*
|
||||
* Initialize a new server
|
||||
*
|
||||
* @svp: Server pointer
|
||||
*
|
||||
* Returns zero on success
|
||||
*/
|
||||
int endpoint_server_init(struct endpoint_server *svp);
|
||||
|
||||
/*
|
||||
* Close the endpoint server
|
||||
*
|
||||
* @svp: Server to close
|
||||
*
|
||||
* Returns zero on success
|
||||
*/
|
||||
int endpoint_server_close(struct endpoint_server *svp);
|
||||
|
||||
#endif /* !ENDPOINT_SERVER_H */
|
||||
Reference in New Issue
Block a user