Changes to last commit
This commit is contained in:
parent
1e3765e53b
commit
44135c4882
20
src/cpm.c
20
src/cpm.c
|
|
@ -73,7 +73,7 @@ bool radar_connection(char* radar_port, facilities_t* facilities){
|
||||||
|
|
||||||
if(facilities->dissemination->tmc_connect == false){
|
if(facilities->dissemination->tmc_connect == false){
|
||||||
|
|
||||||
// Create socket
|
// Create TCP socket
|
||||||
s_socket.i32_socket = socket(AF_INET, SOCK_STREAM, 0);
|
s_socket.i32_socket = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
|
||||||
if(s_socket.i32_socket < 0){
|
if(s_socket.i32_socket < 0){
|
||||||
|
|
@ -96,22 +96,6 @@ bool radar_connection(char* radar_port, facilities_t* facilities){
|
||||||
if(!waitingIncomingConnection()){
|
if(!waitingIncomingConnection()){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Listening to the socket (Waiting for incoming connection)
|
|
||||||
unsigned int len = sizeof(s_socket.s_client);
|
|
||||||
|
|
||||||
if(listen(s_socket.i32_socket,1)<0){
|
|
||||||
syslog_err("Waiting for incoming requests failed...");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if((s_socket.i32_client = accept(s_socket.i32_socket, (struct sockaddr*)&s_socket.s_server, &len)) < 0){
|
|
||||||
syslog_err("Client disconnected...");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
syslog_debug("Radar connected");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create RAW socket
|
// Create RAW socket
|
||||||
|
|
@ -697,8 +681,6 @@ void *cp_service(void *fc){
|
||||||
|
|
||||||
/* Creating sockets and waiting for radar to connect*/
|
/* Creating sockets and waiting for radar to connect*/
|
||||||
is_radar_connected = radar_connection(RADAR_PORT,facilities);
|
is_radar_connected = radar_connection(RADAR_PORT,facilities);
|
||||||
radar_connection(RADAR_PORT,facilities);
|
|
||||||
|
|
||||||
|
|
||||||
while(!facilities->exit){
|
while(!facilities->exit){
|
||||||
usleep(1000*50);
|
usleep(1000*50);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue