Replies: 2 comments 2 replies
-
Ideally, we would grab logs to see where the packet is getting dropped, but with macOS our logging story is a bit sad. I believe you might be able to get console logging working, if you set |
Beta Was this translation helpful? Give feedback.
-
@nibanks I got sidetracked a bit from this project, but before that I did manage to get something running, and will have another go this week at getting it to a state where it is good enough for integration in my app. Once I have something in a not too embarrasing state, I will be happy to share it, however, I found that the existing code's optimizations for maximum throughput on multi-core CPUs were mostly getting in my way, so in the end I found it easier to resort to writing a new and simplified datapath with just a single system socket doing all the work. I am not sure that is how one would do it given more perfect command/understanding of the entire MSQUIC codebase, but at least the code should be useful for reference. |
Beta Was this translation helpful? Give feedback.
-
hi,
I would like to use MSQUIC for peer to peer MacOS app, such that after an initial rendezvous through a central server, peers would be able to connect directly using traditional NAT hole punching. I have this working already with my own UDP-based protocol, but would like to add QUIC to get features like TLS and reliable streams. Basically I use just a single datagram socket and sendto() and recvfrom() instead of doing connect() and bind().
The first thing I noticed was that MSQUIC does a connect() no the UDP socket, which will cause incoming packets to get filtered, so I changed the code in src/platform/datapath_kqueue.c to not do the connect, but instead just make a copy of the address & size arguments to connect(), so that I can set them later in the sendmsg() call, like this:
instead of connect():
and before calling sendmsg():
replaced with:
I've also tried emulating the effect of getsockname() by just faking out a port number, but the code seems happy one way or the other.
However, when trying to run a client that is modified like this against an unmodified server, the packets that get received back from the server seem to be getting silently dropped somewhere higher up in MSQUIC. The packets are sent and I get replies back OK, but a connection never gets established.
Does anyone have hints as to what I may be doing wrong here? I would assume that these changes should not affect anything higher up, but clearly I am wrong.
Thanks in advance!
Jacob
Beta Was this translation helpful? Give feedback.
All reactions