-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiffs.udpcli_hang
80 lines (72 loc) · 2.07 KB
/
diffs.udpcli_hang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
diff --git a/ltp/udp/libudplsa.c b/ltp/udp/libudplsa.c
index 9d57b816..3d791ecb 100644
--- a/ltp/udp/libudplsa.c
+++ b/ltp/udp/libudplsa.c
@@ -31,6 +31,7 @@ void *udplsa_handle_datagrams(void *parm)
/* Initialize recvmmsg buffers. */
+writeMemo("udplsa_handle_datagrams is UDP_MULTISEND.");
buffers = MTAKE((UDPLSA_BUFSZ + 1)* MULTIRECV_BUFFER_COUNT);
if (buffers == NULL)
{
@@ -146,6 +147,7 @@ void *udplsa_handle_datagrams(void *parm)
switch (segmentLength)
{
case 0: /* Interrupted system call. */
+writeMemo("libudplsa irecvfrom is interrupted");
continue;
case -1:
@@ -155,6 +157,7 @@ void *udplsa_handle_datagrams(void *parm)
/* Intentional fall-through to next case. */
case 1: /* Normal stop. */
+writeMemo("libudplsa irecvfrom() receives STOP byte");
rtp->running = 0;
continue;
}
diff --git a/ltp/udp/udplsi.c b/ltp/udp/udplsi.c
index 0ed2fa4a..dc1bec7d 100644
--- a/ltp/udp/udplsi.c
+++ b/ltp/udp/udplsi.c
@@ -151,15 +151,21 @@ int main(int argc, char *argv[])
fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (fd >= 0)
{
+#if 0
if (isendto(fd, &quit, 1, 0, &ownSockName,
sizeof(struct sockaddr)) == 1)
{
pthread_join(receiverThread, NULL);
}
+#endif
+oK(isendto(fd, &quit, 1, 0, &ownSockName,
+ sizeof(struct sockaddr)));
+microsnooze(10000);
closesocket(fd);
}
+pthread_detach(receiverThread);
closesocket(rtp.linkSocket);
writeErrmsgMemos();
writeMemo("[i] udplsi has ended.");
diff --git a/ltp/udp/udplso.c b/ltp/udp/udplso.c
index e1d46aef..53341c82 100644
--- a/ltp/udp/udplso.c
+++ b/ltp/udp/udplso.c
@@ -586,15 +586,21 @@ segment batch.", NULL);
fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (fd >= 0)
{
+#if 0
if (isendto(fd, &quit, 1, 0, &ownSockName,
sizeof(struct sockaddr)) == 1)
{
pthread_join(receiverThread, NULL);
}
+#endif
+oK(isendto(fd, &quit, 1, 0, &ownSockName,
+ sizeof(struct sockaddr)));
+microsnooze(10000);
closesocket(fd);
}
+pthread_detach(receiverThread);
closesocket(rtp.linkSocket);
writeErrmsgMemos();
writeMemo("[i] udplso has ended.");