mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Needed to increase buffer size for this to send app.js The logical port status is what is returned in the array, for non-sequential systems we need to map through physToLog rather than just subtracting 1 physToLog is 1 based! not 0; also fixing up typecasts Reimplementing using an array of objects to represent ports. The previous approach of a bitmask of logical ports, was just too simple on devices such as the SWGT024_V2_0_MANAGED which has gaps in the port assignments.
27 lines
433 B
C
27 lines
433 B
C
#ifndef server_h
|
|
#define server_h
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#define BUFFER_SIZE 262144
|
|
|
|
struct Server {
|
|
int domain;
|
|
int port;
|
|
int service;
|
|
int protocol;
|
|
int backlog;
|
|
u_long interface;
|
|
|
|
int socket;
|
|
struct sockaddr_in address;
|
|
|
|
void (*launch)(struct Server *server);
|
|
};
|
|
|
|
struct Server server_Constructor(int port, void (*launch)(struct Server *server));
|
|
void launch(struct Server *server);
|
|
|
|
#endif
|
|
|