summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-03-12 08:35:26 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-03-12 09:00:24 +0100
commit4ed4479bd5e4769d7e162920428467bed722a1fa (patch)
tree558fd01fda6ee6fb6d898ae72992d46de3c1cb1a
parenta2a1ef7f64c75f7fd7500c6d534e5690e7fb286f (diff)
downloadecon-4ed4479bd5e4769d7e162920428467bed722a1fa.tar.gz
econ-4ed4479bd5e4769d7e162920428467bed722a1fa.tar.bz2
econ-4ed4479bd5e4769d7e162920428467bed722a1fa.zip
econserv: Remove duplicate tcp_fd socket
-rw-r--r--econserv.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/econserv.c b/econserv.c
index 109d294..89d3ea9 100644
--- a/econserv.c
+++ b/econserv.c
@@ -93,7 +93,6 @@ static uint8_t cmd21_unknown_data3[112] = {
struct ecs {
int fd;
int udp_fd;
- int tcp_fd;
int client_fd;
int client_fd_data[2];
@@ -321,9 +320,6 @@ int main(int argc, char *argv[])
ecs.udp_fd = bind_socket(SOCK_DGRAM, host, control_port);
assert(ecs.udp_fd >= 0);
- ecs.tcp_fd = bind_socket(SOCK_STREAM, host, control_port);
- listen(ecs.tcp_fd, 1);
-
set_ip(ecs.epkt.rec.IPaddress, sock_get_ipv4_addr(ecs.fd));
memcpy(ecs.epkt.rec.projUniqInfo, ecs.proj_uniq, 6);
ecs.data_index = 0;
@@ -336,8 +332,7 @@ int main(int argc, char *argv[])
FD_SET(ecs.fd, &fds);
FD_SET(ecs.data_fd, &fds);
FD_SET(ecs.udp_fd, &fds);
- FD_SET(ecs.tcp_fd, &fds);
- maxfd = MAX(maxfd, ecs.tcp_fd);
+ maxfd = MAX(maxfd, ecs.udp_fd);
if (ecs.client_fd >= 0) {
FD_SET(ecs.client_fd, &fds);
maxfd = MAX(maxfd, ecs.client_fd);
@@ -367,11 +362,6 @@ int main(int argc, char *argv[])
if (FD_ISSET(ecs.udp_fd, &fds)) {
recv_udp(&ecs);
}
- if (FD_ISSET(ecs.tcp_fd, &fds)) {
- if (ecs.client_fd > 0)
- close(ecs.client_fd);
- ecs.client_fd = accept(ecs.tcp_fd, NULL, NULL);
- }
if (FD_ISSET(ecs.data_fd, &fds)) {
if (ecs.data_index == 2) {
@@ -406,7 +396,6 @@ int main(int argc, char *argv[])
close(ecs.fd);
close(ecs.data_fd);
close(ecs.udp_fd);
- close(ecs.tcp_fd);
return 0;
}