antirez
Constant replaced with macro MODES_NET_SERVICES_NUM.
This commit is contained in:
parent
86093ea95e
commit
f331887b7f
|
@ -163,6 +163,7 @@
|
||||||
#define MODES_INTERACTIVE_DELETE_TTL 300 // Delete from the list after 300 seconds
|
#define MODES_INTERACTIVE_DELETE_TTL 300 // Delete from the list after 300 seconds
|
||||||
#define MODES_INTERACTIVE_DISPLAY_TTL 60 // Delete from display after 60 seconds
|
#define MODES_INTERACTIVE_DISPLAY_TTL 60 // Delete from display after 60 seconds
|
||||||
|
|
||||||
|
#define MODES_NET_SERVICES_NUM 6
|
||||||
#define MODES_NET_MAX_FD 1024
|
#define MODES_NET_MAX_FD 1024
|
||||||
#define MODES_NET_INPUT_RAW_PORT 30001
|
#define MODES_NET_INPUT_RAW_PORT 30001
|
||||||
#define MODES_NET_OUTPUT_RAW_PORT 30002
|
#define MODES_NET_OUTPUT_RAW_PORT 30002
|
||||||
|
|
4
net_io.c
4
net_io.c
|
@ -51,7 +51,7 @@ void modesInitNet(void) {
|
||||||
char *descr;
|
char *descr;
|
||||||
int *socket;
|
int *socket;
|
||||||
int port;
|
int port;
|
||||||
} services[6] = {
|
} services[MODES_NET_SERVICES_NUM] = {
|
||||||
{"Raw TCP output", &Modes.ros, Modes.net_output_raw_port},
|
{"Raw TCP output", &Modes.ros, Modes.net_output_raw_port},
|
||||||
{"Raw TCP input", &Modes.ris, Modes.net_input_raw_port},
|
{"Raw TCP input", &Modes.ris, Modes.net_input_raw_port},
|
||||||
{"Beast TCP output", &Modes.bos, Modes.net_output_beast_port},
|
{"Beast TCP output", &Modes.bos, Modes.net_output_beast_port},
|
||||||
|
@ -64,7 +64,7 @@ void modesInitNet(void) {
|
||||||
memset(Modes.clients,0,sizeof(Modes.clients));
|
memset(Modes.clients,0,sizeof(Modes.clients));
|
||||||
Modes.maxfd = -1;
|
Modes.maxfd = -1;
|
||||||
|
|
||||||
for (j = 0; j < 6; j++) {
|
for (j = 0; j < MODES_NET_SERVICES_NUM; j++) {
|
||||||
int s = anetTcpServer(Modes.aneterr, services[j].port, NULL);
|
int s = anetTcpServer(Modes.aneterr, services[j].port, NULL);
|
||||||
if (s == -1) {
|
if (s == -1) {
|
||||||
fprintf(stderr, "Error opening the listening port %d (%s): %s\n",
|
fprintf(stderr, "Error opening the listening port %d (%s): %s\n",
|
||||||
|
|
Loading…
Reference in a new issue