-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single thread #339
Single thread #339
Conversation
Nit: You should probably attribute @ccaughie in the commits with |
Please add the |
Done.
Done. |
Please fix compiler warning:
|
Done, I was not getting such warning. |
OS: FreeBSD
OS: NetBSD & Ubuntu
OS: Windows MINGW
|
This should be fixed by doing: static void init_sync(void) {
This should be fixed by doing: if (*option_len < (socklen_t)(sizeof(int))) { |
This is cherry picked from #339, since it is not related.
usrsctplib/user_socket.c
Outdated
|
||
if ((sb->sb_flags & SB_UPCALL) && so->so_upcall != NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do really not know why this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tuexen, as said, this is an extract from #38. I've tried to extract merely the parts related to the single thread. We've tested quite intensively and it's working as per our usage. I cannot determine the reason of such change nor whether it is necessary or not.
Please, feel free to edit the code if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is not needed. We currently call the upcall after we processed the triggering event. So please remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in versatica@3ca5f0b.
This reverts commit 1e240a9.
@weinrank, I have a macOs in my hand, please feel free to make the required modifications to the code. |
No idea about how to fix this error in FreeBSD. The exact code is: static const clock_t clocks_per_msec = CLOCKS_PER_SEC / 1000;
return clock() / clocks_per_msec; How can it complain? https://en.cppreference.com/w/c/chrono/CLOCKS_PER_SEC Perhaps |
The reason of the error is that on FreeBSD |
programs/st_client.c
Outdated
tv.tv_sec = wait_time / 1000; | ||
tv.tv_usec = (wait_time % 1000) * 1000; | ||
|
||
select(1, &rfds, NULL, NULL, &tv); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really work? rfds
need to be setup up with
FD_ZERO(&rfds);
FD_SET(sock, &rfds);
before each select()
call. You also need to use sock + 1
as its first argument.
programs/st_client.c
Outdated
|
||
select(1, &rfds, NULL, NULL, &tv); | ||
|
||
length = recv(sock, buf, MAX_PACKET_SIZE, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you only want to do this if FD_ISSET(sock, rdfs)
is true. If that is not true, you can't read anything from the socket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tuexen. Honestly this st_client.c
is at it was in the original PR. Indeed we cannot make it work. I'm adding changes told by you and also documenting into it how to use it:
/*
* Usage: st_client local_addr local_port remote_addr remote_port remote_sctp_port
*/
I've added some prints into st_client.c
to figure out what is happening:
wait_time = next_fire_time - now;
tv.tv_sec = wait_time / 1000;
tv.tv_usec = (wait_time % 1000) * 1000;
FD_ZERO(&rfds);
FD_SET(sock, &rfds);
if (FD_ISSET(sock, &rfds))
printf("--- FD_ISSET(sock, &rfds): yes\n");
printf("--- calling select()\n");
select(sock + 1, &rfds, NULL, NULL, &tv);
printf("--- calling recv() 2\n");
length = recv(sock, buf, MAX_PACKET_SIZE, 0);
printf("--- recv() returned, length:%zu\n", length);
if (length > 0) {
if ((dump_buf = usrsctp_dumppacket(buf, (size_t)length, SCTP_DUMP_INBOUND)) != NULL) {
fprintf(stderr, "%s", dump_buf);
usrsctp_freedumpbuffer(dump_buf);
}
usrsctp_conninput(sconn_addr, buf, (size_t)length, 0);
}
}
Testing it:
# run server
$ ./echo_server 11111 22222
# run client
$ ./st_client 127.0.0.1 22222 127.0.0.1 11111 11111
It produces zero output in the server and this output in the client:
O 16:20:33.113793 0000 f9 7d 2b 67 00 00 00 00 68 43 df cd 01 00 00 56 1c ce f2 40 00 02 00 00 00 0a 08 00 08 eb c4 6b c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 f6 82 90 8c a6 0d 41 8d ef 6c 26 22 c5 43 3c ec 43 25 62 64 28 8e 77 42 de ab 4a e8 92 45 99 aa 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 # SCTP_PACKET
--- FD_ISSET(sock, &rfds): yes
--- calling select()
--- calling recv() 2
and it gets stuck in the length = recv(sock, buf, MAX_PACKET_SIZE, 0);
line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try something like:
wait_time = next_fire_time - now;
tv.tv_sec = wait_time / 1000;
tv.tv_usec = (wait_time % 1000) * 1000;
FD_ZERO(&rfds);
FD_SET(sock, &rfds);
printf("--- calling select()\n");
select(sock + 1, &rfds, NULL, NULL, &tv);
if (FD_ISSET(sock, &rfds)) {
printf("--- FD_ISSET(sock, &rfds): yes\n");
printf("--- calling recv() 2\n");
length = recv(sock, buf, MAX_PACKET_SIZE, 0);
printf("--- recv() returned, length:%zu\n", length);
if (length > 0) {
if ((dump_buf = usrsctp_dumppacket(buf, (size_t)length, SCTP_DUMP_INBOUND)) != NULL) {
fprintf(stderr, "%s", dump_buf);
usrsctp_freedumpbuffer(dump_buf);
}
usrsctp_conninput(sconn_addr, buf, (size_t)length, 0);
}
} else {
printf("--- FD_ISSET(sock, &rfds): no\n");
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid it just produces this output in the client (and nothing in the server):
$ ./st_client 127.0.0.1 22222 127.0.0.1 11111 11111
O 16:42:57.634535 0000 fd 80 2b 67 00 00 00 00 7b 61 7a 09 01 00 00 56 74 5a ce b6 00 02 00 00 00 0a 08 00 ba 43 c8 36 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 ca d1 11 0b cd 3b 90 b9 97 05 7c 28 e7 c9 b2 14 cd e1 91 be 2d 72 82 45 68 9c 1c e1 f1 17 db 56 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 # SCTP_PACKET
--- calling select()
--- FD_ISSET(sock, &rfds): no
--- calling select()
--- FD_ISSET(sock, &rfds): no
--- calling select()
--- FD_ISSET(sock, &rfds): no
--- calling select()
--- FD_ISSET(sock, &rfds): no
// etc etc etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that, even if st_client
command line arguments are a bit pain, I'm using them correctly (OSX):
$ lsof -i -n -P | grep -E '(echo_se|st_client)'
echo_serv 25145 ibc 4u IPv4 0xb020ae295166cc0d 0t0 UDP *:11111
echo_serv 25145 ibc 5u IPv6 0xb020ae2951670a95 0t0 UDP *:11111
st_client 25554 ibc 3u IPv4 0xb020ae294236373d 0t0 UDP 127.0.0.1:22222->127.0.0.1:11111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow the echo server is not responding to the st_client
:
16:52:30.607280 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 100
16:52:30.607293 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 100
16:52:33.610211 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 100
16:52:33.610226 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 100
However, it does reply to the client
program:
16:53:49.217415 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 156
16:53:49.217459 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 156
16:53:49.217821 IP 127.0.0.1.11111 > 127.0.0.1.22222: UDP, length 564
16:53:49.217847 IP 127.0.0.1.11111 > 127.0.0.1.22222: UDP, length 564
16:53:49.218336 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 428
16:53:49.218366 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 428
16:53:49.221919 IP 127.0.0.1.11111 > 127.0.0.1.22222: UDP, length 16
16:53:49.221963 IP 127.0.0.1.11111 > 127.0.0.1.22222: UDP, length 16
16:53:49.222080 IP 192.168.1.55.11111 > 192.168.1.55.22222: UDP, length 56
16:53:49.222092 IP 192.168.1.55.11111 > 192.168.1.55.22222: UDP, length 56
16:53:49.222131 IP 5.5.5.5.11111 > 5.5.5.5.22222: UDP, length 56
16:53:49.222142 IP 5.5.5.5.11111 > 5.5.5.5.22222: UDP, length 56
16:53:49.222214 IP6 ::1.11111 > ::1.22222: UDP, length 56
16:53:49.222226 IP6 ::1.11111 > ::1.22222: UDP, length 56
16:53:49.223098 IP 192.168.1.55.22222 > 192.168.1.55.11111: UDP, length 56
16:53:49.223118 IP 192.168.1.55.22222 > 192.168.1.55.11111: UDP, length 56
16:53:49.223258 IP 5.5.5.5.22222 > 5.5.5.5.11111: UDP, length 56
16:53:49.223271 IP 5.5.5.5.22222 > 5.5.5.5.11111: UDP, length 56
16:53:49.223362 IP6 ::1.22222 > ::1.11111: UDP, length 56
16:53:49.223375 IP6 ::1.22222 > ::1.11111: UDP, length 56
16:53:49.224581 IP 192.168.1.55.11111 > 192.168.1.55.22222: UDP, length 56
16:53:49.224594 IP 192.168.1.55.11111 > 192.168.1.55.22222: UDP, length 56
16:53:49.224637 IP6 ::1.22222 > ::1.11111: UDP, length 56
16:53:49.224647 IP6 ::1.22222 > ::1.11111: UDP, length 56
16:53:49.225255 IP6 ::1.11111 > ::1.22222: UDP, length 56
16:53:49.225268 IP6 ::1.11111 > ::1.22222: UDP, length 56
16:53:49.225361 IP 192.168.1.55.22222 > 192.168.1.55.11111: UDP, length 56
16:53:49.225372 IP 192.168.1.55.22222 > 192.168.1.55.11111: UDP, length 56
16:53:49.225438 IP 5.5.5.5.22222 > 5.5.5.5.11111: UDP, length 56
16:53:49.225448 IP 5.5.5.5.22222 > 5.5.5.5.11111: UDP, length 56
16:53:49.225540 IP 5.5.5.5.11111 > 5.5.5.5.22222: UDP, length 56
16:53:49.225553 IP 5.5.5.5.11111 > 5.5.5.5.22222: UDP, length 56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No sure why the server is listed twice...
Because it's listening in IPv4 and IPv6.
If you capture the traffic on the UDP interface, do you see an INIT-ACK encapsulated in UDP? If yes, then there is a problem on the client side. If no, there is a problem on the server side.
Another point: After 1 second there should be a transmission of the INIT. So a timer should run off. Does this happen?
I just see traffic from st_client
to echo_server
, and yes there are retransmissions (I assume it's the INIT):
// run server:
$ ./echo_server 11111 22222
// run client:
$ ./st_client 127.0.0.1 22222 127.0.0.1 11111 11111
// stdout in client:
16:57:50.374429 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 100
16:57:50.374444 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 100
// after 2 seconds:
16:57:53.380791 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 100
16:57:53.380814 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 100
// after 2 seconds:
16:57:59.389498 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 100
16:57:59.389521 IP 127.0.0.1.22222 > 127.0.0.1.11111: UDP, length 100
Not sure if relevant, but the UDP packet size in the first message (SCTP INIT) in client
is 156 bytes, while in st_client
it's 100 bytes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm starting to understand that both echo_server
and client
use:
sock = usrsctp_socket(AF_INET6, SOCK_STREAM, IPPROTO_SCTP...
while in st_client
it is:
usrsctp_socket(AF_CONN, SOCK_STREAM, IPPROTO_SCTP...
so obviously this won't work...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here we go:
- In the server:
$ ./ekr_server 127.0.0.1 11111 127.0.0.1 22222
- In the client:
$ ./st_client 127.0.0.1 22222 127.0.0.1 11111 11111
- Logs in the client:
O 17:20:18.738085 0000 e6 03 2b 67 00 00 00 00 db 5e ee 70 01 00 00 56 9f 90 25 4c 00 02 00 00 00 0a 08 00 5a 3b ef b4 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 1c 50 e9 7e b2 02 5e 11 88 a4 2c 1d e8 f7 f8 63 78 2a e8 1b 29 1a 05 61 ab e7 4e d8 d0 49 92 84 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 # SCTP_PACKET
--- calling select()
--- FD_ISSET(sock, &rfds): yes
--- calling recv() 2
--- recv() returned, length:16
- Logs in the server:
I 17:20:18.739651 0000 e6 03 2b 67 00 00 00 00 db 5e ee 70 01 00 00 56 9f 90 25 4c 00 02 00 00 00 0a 08 00 5a 3b ef b4 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 1c 50 e9 7e b2 02 5e 11 88 a4 2c 1d e8 f7 f8 63 78 2a e8 1b 29 1a 05 61 ab e7 4e d8 d0 49 92 84 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 # SCTP_PACKET
O 17:20:18.746047 0000 2b 67 e6 03 9f 90 25 4c 7a a4 17 76 06 00 00 04 # SCTP_PACKET
Obviously the ekr_server
is not a echo server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, st_client
can talk to itself:
$ ./st_client 127.0.0.1 11111 127.0.0.1 22222 11111
and
$ ./st_client 127.0.0.1 22222 127.0.0.1 11111 11111
Logs in the first st_client:
O 17:23:57.090391 0000 e8 07 2b 67 00 00 00 00 51 9d 2d f4 01 00 00 56 9d bf 3d d0 00 02 00 00 00 0a 08 00 ae 6b 52 c5 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 98 76 2e 70 04 b2 19 55 21 41 ac 43 5e 57 df 97 b4 08 ae f1 1c 30 5d 2d 26 c2 c7 1f 85 d6 67 41 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 # SCTP_PACKET
I 17:23:57.091196 0000 2b 67 e8 07 9d bf 3d d0 f1 fb 6f 02 06 00 00 04 # SCTP_PACKET
Logs in the second st_client:
O 17:23:54.605069 0000 e8 e6 2b 67 00 00 00 00 e4 c2 d9 13 01 00 00 56 c4 05 38 55 00 02 00 00 00 0a 08 00 ba 1f f2 42 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 44 d4 42 93 b6 ab 94 b1 05 da 28 e9 9b 47 5d 51 c9 70 e8 a7 1b 3e 47 36 85 83 13 48 e1 23 95 ea 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 # SCTP_PACKET
I 17:23:57.091071 0000 e8 07 2b 67 00 00 00 00 51 9d 2d f4 01 00 00 56 9d bf 3d d0 00 02 00 00 00 0a 08 00 ae 6b 52 c5 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 98 76 2e 70 04 b2 19 55 21 41 ac 43 5e 57 df 97 b4 08 ae f1 1c 30 5d 2d 26 c2 c7 1f 85 d6 67 41 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 # SCTP_PACKET
@ibc: Can you tell me what errors you are observing? What are the failing unit tests testing? |
@tuexen: The unit tests failing are not related to usrsctp. They are unit tests in our server, in which we use node-sctp (SCTP lib for Node) to send and receive SCTP messages through our server (which integrates usrsctp in single-thread mode). Eventually it has failed this morning twice. The error is just that some messages were not received (localhost test, reliable SCTP streams). But, we were compiling and recompiling the server all the time, who knows. I'll try to verify tomorrow whether it works fine or not and update here. Thanks. |
Setting
Neither the stream (0), TSN (4170287217) nor the PPID (63) is reported correctly. Full output:
|
@weinrank: I guess you need to call:
without that, you are displaying uninitialized memory... Does this help? |
Hi, where should we add that line? In which file? I do not see any |
BTW |
At line 333 in the main function should be fine. You also need a local variable being declared at the beginning of the main function using:
|
In st_client.c you mean? |
Yes. I'm trying to get the client working... |
…CVRCVINFO, &on, sizeof(int))
Thanks @tuexen, I've added it. I'm still not sure what the output of st_client should be when connected to ekr_server. This is what I get: $ ./ekr_server 127.0.0.1 11111 127.0.0.1 22222
I 13:49:25.892677 0000 cd c1 2b 67 00 00 00 00 3b 84 0b 5f 01 00 00 56 fb 1f 32 f4 00 02 00 00 00 0a 08 00 e0 ea da 9b c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 58 b8 77 ae b3 23 97 5e 08 14 6f 71 fa 85 bc a5 7e cd 93 6c 29 49 1b 4f 9f c7 74 b7 87 16 e1 8e 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 # SCTP_PACKET
O 13:49:25.893346 0000 2b 67 cd c1 fb 1f 32 f4 16 a4 15 b5 06 00 00 04 # SCTP_PACKET $ ./st_client 127.0.0.1 22222 127.0.0.1 11111 11111
O 13:49:25.892035 0000 cd c1 2b 67 00 00 00 00 3b 84 0b 5f 01 00 00 56 fb 1f 32 f4 00 02 00 00 00 0a 08 00 e0 ea da 9b c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 58 b8 77 ae b3 23 97 5e 08 14 6f 71 fa 85 bc a5 7e cd 93 6c 29 49 1b 4f 9f c7 74 b7 87 16 e1 8e 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 # SCTP_PACKET
I 13:49:25.893417 0000 2b 67 cd c1 fb 1f 32 f4 16 a4 15 b5 06 00 00 04 # SCTP_PACKET |
If you want your client to talk to
That should allow an association setup... |
Oh, true. Updated logs then: $ ./st_client 127.0.0.1 22222 127.0.0.1 11111 5001
O 14:08:16.063013 0000 c8 fe 13 89 00 00 00 00 ad 68 40 04 01 00 00 56 bc be 1e 1b 00 02 00 00 00 0a 08 00 cd 94 a8 f9 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 cc bb 77 9e dd 92 6a ca a7 64 cc ad a8 43 d1 a0 c1 94 d4 e7 4f 30 54 ce dc 3d 11 46 b2 3e 0f 28 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 # SCTP_PACKET
I 14:08:16.064651 0000 13 89 c8 fe bc be 1e 1b 51 93 da 39 02 00 01 90 7d d3 3a ae 00 02 00 00 00 0a 08 00 db a5 e9 78 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 67 0c 3f 41 6c 20 cc 7d c8 00 76 41 ff d7 62 6e 31 97 2a a7 9e 90 bd 24 3f e4 4d 6e 52 0c 57 ad 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 00 07 01 38 4b 41 4d 45 2d 42 53 44 20 31 2e 31 00 00 00 00 b0 56 51 5d 00 00 00 00 55 fb 00 00 00 00 00 00 60 ea 00 00 00 00 00 00 00 00 00 00 1b 1e be bc 7d d3 3a ae bc 65 b3 eb fe 7f 00 00 00 00 00 00 00 00 00 00 04 00 00 00 bc 65 b3 eb fe 7f 00 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 c8 fe 13 89 00 00 01 00 00 00 00 00 00 00 00 00 01 00 00 56 bc be 1e 1b 00 02 00 00 00 0a 08 00 cd 94 a8 f9 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 cc bb 77 9e dd 92 6a ca a7 64 cc ad a8 43 d1 a0 c1 94 d4 e7 4f 30 54 ce dc 3d 11 46 b2 3e 0f 28 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 02 00 01 90 7d d3 3a ae 00 02 00 00 00 0a 08 00 db a5 e9 78 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 67 0c 3f 41 6c 20 cc 7d c8 00 76 41 ff d7 62 6e 31 97 2a a7 9e 90 bd 24 3f e4 4d 6e 52 0c 57 ad 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 21 e0 42 c6 10 03 eb a3 7a 23 90 61 27 52 ac 4c 21 c7 03 97 # SCTP_PACKET
O 14:08:16.064990 0000 c8 fe 13 89 7d d3 3a ae da 99 5e 46 0a 00 01 38 4b 41 4d 45 2d 42 53 44 20 31 2e 31 00 00 00 00 b0 56 51 5d 00 00 00 00 55 fb 00 00 00 00 00 00 60 ea 00 00 00 00 00 00 00 00 00 00 1b 1e be bc 7d d3 3a ae bc 65 b3 eb fe 7f 00 00 00 00 00 00 00 00 00 00 04 00 00 00 bc 65 b3 eb fe 7f 00 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 c8 fe 13 89 00 00 01 00 00 00 00 00 00 00 00 00 01 00 00 56 bc be 1e 1b 00 02 00 00 00 0a 08 00 cd 94 a8 f9 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 cc bb 77 9e dd 92 6a ca a7 64 cc ad a8 43 d1 a0 c1 94 d4 e7 4f 30 54 ce dc 3d 11 46 b2 3e 0f 28 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 02 00 01 90 7d d3 3a ae 00 02 00 00 00 0a 08 00 db a5 e9 78 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 67 0c 3f 41 6c 20 cc 7d c8 00 76 41 ff d7 62 6e 31 97 2a a7 9e 90 bd 24 3f e4 4d 6e 52 0c 57 ad 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 21 e0 42 c6 10 03 eb a3 7a 23 90 61 27 52 ac 4c 21 c7 03 97 # SCTP_PACKET
I 14:08:16.065468 0000 13 89 c8 fe bc be 1e 1b af 60 24 f1 0b 00 00 04 # SCTP_PACKET
O 14:08:16.065599 0000 c8 fe 13 89 7d d3 3a ae db 96 84 2a 00 03 00 60 cd 94 a8 f9 00 00 00 00 00 00 00 27 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 # SCTP_PACKET
I 14:08:16.065864 0000 13 89 c8 fe bc be 1e 1b af 30 4d 05 03 00 00 10 cd 94 a8 f9 00 02 00 00 00 00 00 00 # SCTP_PACKET $ ./ekr_server 127.0.0.1 11111 127.0.0.1 22222
I 14:08:16.063672 0000 c8 fe 13 89 00 00 00 00 ad 68 40 04 01 00 00 56 bc be 1e 1b 00 02 00 00 00 0a 08 00 cd 94 a8 f9 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 cc bb 77 9e dd 92 6a ca a7 64 cc ad a8 43 d1 a0 c1 94 d4 e7 4f 30 54 ce dc 3d 11 46 b2 3e 0f 28 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 # SCTP_PACKET
O 14:08:16.064415 0000 13 89 c8 fe bc be 1e 1b 51 93 da 39 02 00 01 90 7d d3 3a ae 00 02 00 00 00 0a 08 00 db a5 e9 78 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 67 0c 3f 41 6c 20 cc 7d c8 00 76 41 ff d7 62 6e 31 97 2a a7 9e 90 bd 24 3f e4 4d 6e 52 0c 57 ad 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 00 07 01 38 4b 41 4d 45 2d 42 53 44 20 31 2e 31 00 00 00 00 b0 56 51 5d 00 00 00 00 55 fb 00 00 00 00 00 00 60 ea 00 00 00 00 00 00 00 00 00 00 1b 1e be bc 7d d3 3a ae bc 65 b3 eb fe 7f 00 00 00 00 00 00 00 00 00 00 04 00 00 00 bc 65 b3 eb fe 7f 00 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 c8 fe 13 89 00 00 01 00 00 00 00 00 00 00 00 00 01 00 00 56 bc be 1e 1b 00 02 00 00 00 0a 08 00 cd 94 a8 f9 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 cc bb 77 9e dd 92 6a ca a7 64 cc ad a8 43 d1 a0 c1 94 d4 e7 4f 30 54 ce dc 3d 11 46 b2 3e 0f 28 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 02 00 01 90 7d d3 3a ae 00 02 00 00 00 0a 08 00 db a5 e9 78 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 67 0c 3f 41 6c 20 cc 7d c8 00 76 41 ff d7 62 6e 31 97 2a a7 9e 90 bd 24 3f e4 4d 6e 52 0c 57 ad 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 21 e0 42 c6 10 03 eb a3 7a 23 90 61 27 52 ac 4c 21 c7 03 97 # SCTP_PACKET
I 14:08:16.065064 0000 c8 fe 13 89 7d d3 3a ae da 99 5e 46 0a 00 01 38 4b 41 4d 45 2d 42 53 44 20 31 2e 31 00 00 00 00 b0 56 51 5d 00 00 00 00 55 fb 00 00 00 00 00 00 60 ea 00 00 00 00 00 00 00 00 00 00 1b 1e be bc 7d d3 3a ae bc 65 b3 eb fe 7f 00 00 00 00 00 00 00 00 00 00 04 00 00 00 bc 65 b3 eb fe 7f 00 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 c8 fe 13 89 00 00 01 00 00 00 00 00 00 00 00 00 01 00 00 56 bc be 1e 1b 00 02 00 00 00 0a 08 00 cd 94 a8 f9 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 cc bb 77 9e dd 92 6a ca a7 64 cc ad a8 43 d1 a0 c1 94 d4 e7 4f 30 54 ce dc 3d 11 46 b2 3e 0f 28 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 02 00 01 90 7d d3 3a ae 00 02 00 00 00 0a 08 00 db a5 e9 78 c0 00 00 04 80 08 00 09 c0 0f c1 80 82 00 00 00 80 02 00 24 67 0c 3f 41 6c 20 cc 7d c8 00 76 41 ff d7 62 6e 31 97 2a a7 9e 90 bd 24 3f e4 4d 6e 52 0c 57 ad 80 04 00 06 00 01 00 00 80 03 00 06 80 c1 00 00 21 e0 42 c6 10 03 eb a3 7a 23 90 61 27 52 ac 4c 21 c7 03 97 # SCTP_PACKET
O 14:08:16.065421 0000 13 89 c8 fe bc be 1e 1b af 60 24 f1 0b 00 00 04 # SCTP_PACKET
I 14:08:16.065688 0000 c8 fe 13 89 7d d3 3a ae db 96 84 2a 00 03 00 60 cd 94 a8 f9 00 00 00 00 00 00 00 27 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 # SCTP_PACKET
Msg of length 80 received via 0x7ffeebb365bc:51454 on stream 0 with SSN 0 and TSN 3449071865, PPID 39, context 0.
O 14:08:16.065775 0000 13 89 c8 fe bc be 1e 1b af 30 4d 05 03 00 00 10 cd 94 a8 f9 00 02 00 00 00 00 00 00 # SCTP_PACKET And after that there are some pings/pongs. |
Yepp, that is expected. Both sides expect its' peer to initiate the association teardown. Did you had a chance to revisit the situation regarding #339 (diff)? That seems to be the last open point in this PR... |
I've executed my server unit tests 2000 times and could not reproduce such a sporadic error, so I understand it happened while compiling, cleaning, etc the whole code. |
Thanks to all for helping to get this in the master tree! |
Super thanks! |
BTW this PR makes usrsctp work in single thread environments by forcing the application call This is, the application provides an input to the lib (via Of course, this design would need tons of changes in the lib, as every action should recalculate the time that |
Also many thanks for your efforts on making this PR into master branch! |
If I understand you correctly, all you want is a function So if you need |
Thanks. I've open an issue for it: #349 |
Based on 010fcbc