diff --git a/UDPclient.cbp b/UDPclient.cbp
index b61d665..b9c8dbd 100644
--- a/UDPclient.cbp
+++ b/UDPclient.cbp
@@ -35,6 +35,10 @@
+
+
+
+
diff --git a/UDPclient.depend b/UDPclient.depend
index 3b36cdc..8e2aa30 100644
--- a/UDPclient.depend
+++ b/UDPclient.depend
@@ -29,7 +29,7 @@
-1395876570 source:/home/chch/HengLongUDPclient/main.c
+1395876660 source:/home/chch/HengLongUDPclient/main.c
@@ -166,7 +166,7 @@
1395699958 /home/chch/HengLongUDPclient/extern.h
-1395871885 /home/chch/HengLongUDPclient/checkvideo.h
+1395878228 /home/chch/HengLongUDPclient/checkvideo.h
diff --git a/UDPclient.layout b/UDPclient.layout
index a0d800b..b73ba29 100644
--- a/UDPclient.layout
+++ b/UDPclient.layout
@@ -1,8 +1,14 @@
-
-
+
+
+
+
+
+
+
+
@@ -17,10 +23,10 @@
-
+
-
+
diff --git a/bin/Debug/UDPclient b/bin/Debug/UDPclient
index 9442034..3181e89 100755
Binary files a/bin/Debug/UDPclient and b/bin/Debug/UDPclient differ
diff --git a/checkvideo.c b/checkvideo.c
index 576ba3f..3c85147 100644
--- a/checkvideo.c
+++ b/checkvideo.c
@@ -1,7 +1,7 @@
#include "checkvideo.h"
-int connectionstate(char* remip, uint16_t remport)
+int connectionstate(char* remip, uint16_t remport, uint32_t state)
{
FILE* tcpfile;
char line[256];
@@ -15,9 +15,9 @@ int connectionstate(char* remip, uint16_t remport)
tcpfile = fopen("/proc/net/tcp","r");
while(fgets(line,256,tcpfile)){
sscanf(line, "%*u: %*x:%*x %x:%x %x", &remipi, &remporti, &statei);
- if((inet_addr(remip)==remipi) & (remport==remporti)) {
+ if((inet_addr(remip)==remipi) & (remport==remporti) & (state==statei)) {
fclose(tcpfile);
- return statei;
+ return 1;
}
}
fclose(tcpfile);
@@ -27,6 +27,6 @@ int connectionstate(char* remip, uint16_t remport)
int checkvideo(char* remip, uint16_t remport)
{
if(0==remip[0]) return 2;
- if(1==connectionstate(remip, remport)) return 1;
+ if(1==connectionstate(remip, remport, 1)) return 1;
return 0;
}
diff --git a/checkvideo.h b/checkvideo.h
index 39ef5f0..c32964c 100644
--- a/checkvideo.h
+++ b/checkvideo.h
@@ -6,7 +6,7 @@
#include
#include
-int connectionstate(char* remip, uint16_t remport);
+int connectionstate(char* remip, uint16_t remport, uint32_t state);
int checkvideo(char* remip, uint16_t remport);
#endif // CHECKVIDEO_H_INCLUDED
diff --git a/obj/Debug/checkvideo.o b/obj/Debug/checkvideo.o
index 4d5a8a3..39107a3 100644
Binary files a/obj/Debug/checkvideo.o and b/obj/Debug/checkvideo.o differ