Commit 58f46941 authored by GUYOT DOMINIQUE's avatar GUYOT DOMINIQUE
Browse files

add stderr debug for client (do not buffer...)

do not close server at disconnection -> an other connection can use it.
rename close function to close_tcp because this should only close a tcp connection...
parent 7588cfcb
......@@ -20,7 +20,7 @@
#define ACTION_KILL 6
//debug
#define PL printf("%s : %d\n",__FUNCTION__,__LINE__);
#define PL fprintf(stderr, "%s : %d\n",__FUNCTION__,__LINE__);
#define PVA(X) printf("%p at %p\n", X, &X);
#define PH(X) fprintf(stderr,"%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\n",X.uint64[0],X.uint64[1],X.uint64[2],X.uint64[3],X.uint64[4],X.uint64[5],X.uint64[6],X.uint64[7]);
......
......@@ -19,7 +19,7 @@
#define ACTION_KILL 6
//debug
#define PL fprintf(stderr,"%s : %d\n",__FUNCTION__,__LINE__);
#define PL fprintf(stderr, "%s : %d\n",__FUNCTION__,__LINE__);
#define PVA(X) fprintf(stderr,"(%s) : %p at address %p\n", #X, X, &(X));
#define PH(X) fprintf(stderr,"%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\n",X.uint64[0],X.uint64[1],X.uint64[2],X.uint64[3],X.uint64[4],X.uint64[5],X.uint64[6],X.uint64[7]);
......@@ -245,7 +245,7 @@ PL
PL
//disconnection
if (nread == UV_EOF || nread == UV_ECONNRESET) {
close();
close_tcp();
}
//error handling
else {
......@@ -254,7 +254,7 @@ PL
PL
}
void close(){
void close_tcp(){
PL
uv_handle_t* handle = reinterpret_cast<uv_handle_t*>(tcp);
uv_close(handle,
......@@ -265,7 +265,7 @@ PL
PL
}
);
uv_close(reinterpret_cast<uv_handle_t*>(static_cast<Service*>(handle->data)->server), NULL);
//uv_close(reinterpret_cast<uv_handle_t*>(static_cast<Service*>(handle->data)->server), NULL);
PL
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment