Constant replaced with macro MODES_NET_SERVICES_NUM.
This commit is contained in:
Malcolm Robb 2014-02-22 22:20:25 +00:00
parent 86093ea95e
commit f331887b7f
2 changed files with 3 additions and 2 deletions

View file

@ -163,6 +163,7 @@
#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_NET_SERVICES_NUM 6
#define MODES_NET_MAX_FD 1024
#define MODES_NET_INPUT_RAW_PORT 30001
#define MODES_NET_OUTPUT_RAW_PORT 30002

View file

@ -51,7 +51,7 @@ void modesInitNet(void) {
char *descr;
int *socket;
int port;
} services[6] = {
} services[MODES_NET_SERVICES_NUM] = {
{"Raw TCP output", &Modes.ros, Modes.net_output_raw_port},
{"Raw TCP input", &Modes.ris, Modes.net_input_raw_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));
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);
if (s == -1) {
fprintf(stderr, "Error opening the listening port %d (%s): %s\n",