diff --git a/remote/tcpdserver.c b/remote/tcpdserver.c index 61e3b46..f6369f3 100644 --- a/remote/tcpdserver.c +++ b/remote/tcpdserver.c @@ -1,5 +1,5 @@ #include "tcpdserver.h" -#include "../lib.communication.h" +#include "../lib/communication.h" #include #include @@ -162,7 +162,7 @@ void * listen_thread(void * pdata) { return NULL; }*/ - pthread_t senPid; + pthread_t sendPid; int ret = pthread_create( &sendPid, NULL, &send_thread, (void *) pda); if (ret) { perror("pthread_create()"); @@ -178,7 +178,7 @@ void * listen_thread(void * pdata) { } } - pthread_join(listenPid, NULL); + pthread_join(sendPid, NULL); return NULL; } diff --git a/remote/tcpdserver.h b/remote/tcpdserver.h index 025412a..e47c338 100644 --- a/remote/tcpdserver.h +++ b/remote/tcpdserver.h @@ -14,12 +14,23 @@ typedef struct { int initConnection (); void endConnection (int sock, int csock); + void printClientAddr (struct sockaddr_in *csin); + void write_message(int sock, const char *buffer); int read_message(int sock, char *buffer); -void * listen_thread(void * p_data); + +//2 threads for listen and send data +void * listen_thread(void * pdata); +void * send_thread(void * pdata); + +//parse the first message from client in service and version void parseServiceVersion(char * buf, char ** service, int *version); + +//create 2 pathnames such as : pid-index-version-in/out void inOutPathCreate(char ** pathname, int version); + +//create a fifo file int fifo_create (char * path);