Repository navigation
Conversation
5e1a658 to
0ae51e2
Compare
7ad1d1f to
d939e5b
Compare
|
So the next stage of implementation has been achieved: client-side support in the Connect dialog.
It has been tested by using Examples for a directory-enabled server running on port 22120:
Note that
|
|
The next step is to try implementing the connected-mode TCP described here |
| bool bUseTranslation = true; | ||
| bool bCustomPortNumberGiven = false; | ||
| bool bEnableIPv6 = false; | ||
| bool bEnableTcp = false; |
There was a problem hiding this comment.
Since we'll have a long time for the 4.0 release, I'd enable it by default soon (of course once we've tested that the basics work)
There was a problem hiding this comment.
No, I disagree. It's a server-only option, and most servers operators will not need to enable TCP support. Only those running large directories or large servers will need to, and they also need to understand and configure their firewall requirements.
TCP support in the client will indeed be enabled by default, but will only take effect when talking to a directory or server that has enabled it.
If a server operator enables TCP without having configured their firewall correctly, client users could have problems as the server would advertise TCP support to the client, but the client could be unable to connect.
There was a problem hiding this comment.
Can we not give an error message or fallback procedure in case the TCP connection timed out?
There was a problem hiding this comment.
Yes, I'm sure we can. I haven't yet tested that scenario.
But it doesn't negate my view that server-side TCP support needs to be an explicit option.
There was a problem hiding this comment.
There was a problem hiding this comment.
Since when do we have a long time?
There's absolutely no benefit to anyone involved in the project - developers or users - in having long release cycles.
A version cut takes very little time - apart from the translation process. Even then, getting used to more, small changes is likely to speed things up generally.
|
Well I've finished implementing everything I intended to, for directory, server and client, so it's ready for reviewing and trying out, as and when time permits (post 3.12.0). I have a private directory and server built and running with TCP support, at In order to demonstrate the use of TCP in a new client's connect dialog, it will be necessary to use custom firewall filters on the client end to temporarily drop incoming UDP Jamulus protocol messages containing a server list or connected clients list. There is full forward and backward compatibility between clients and servers built with TCP support and older versions. |
|
Keeping as draft, because it will need quite a few debug messages removed before merging. |
- Use better randomn number generator - Only include TCP in server features if a listener is running (which it always should be)
This is so that CClient::OnSendCLProtMessage can identify the correct pendingList hash to use when handling TCP connect errors. The ID is unused by CServer and CTestBench, so is not named.
This reverts commit 6156029.
Re comment from AI review
|
🤖 AI: The two paths this verification left code-traced now have a run: the directory list fetch, and UDP loss, at head Loss: every UDP datagram to the client that does not fit a 1500-byte MTU was dropped. The directory listed 51 servers, so its full list was 2708 bytes; the reduced list (1285 bytes) arrived in every row.
With the TCP port refused, or its SYNs dropped (3.15 s timeout), the next request went out over UDP again. A 34-client connected-clients list (1777 bytes) lost over UDP was recovered over TCP the same way. |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved TCP lifecycle defects can cause use-after-free and deliver stale or misrouted mixer lists when channels are reused or sessions change.
9 open issues
Cancel or reject stale TCP handshakes after session changes · New Prevent multiple channel associations on one TCP connection · New Unlink stale TCP association before reusing a channel slot · New Every accepted peer immediately gets a connection object and a 20 KB receive buffer, with no global…pTcpConnectioncan remain set after the server frees a channel:FreeChannel()never clears it.… Prevent stale UDP lists from overwriting newer TCP state · New Send UDP NAT-opening requests when reusing cached TCP results · New This runs in the high-priority UDP receive path (CSocket::OnDataReceived→… The connect timer is the only timeout, but it is stopped as soon as the handshake succeeds. If the…
2 resolved since last review
Review effort: Balanced
| if ( eProtoMode == PROTO_TCP_LONG ) | ||
| { | ||
| Channel.SetTcpConnection ( pTcpConnection ); // link session connection with channel |
| // link TCP connection with UDP channel | ||
| pTcpConnection->SetChannel ( pChannel ); | ||
| pChannel->SetTcpConnection ( pTcpConnection ); |
| vecChannels[iNewChanID].SetAddress ( InetAddr ); | ||
|
|
||
| // allocate a random channel token for authenticating TCP associations | ||
| vecChannels[iNewChanID].SetChannelToken ( QRandomGenerator::system()->generate() ); |
| { | ||
| if ( pTcpConnection ) | ||
| { | ||
| ConnLessProtocol.CreateCLConnClientsListMes ( InetAddr, vecChanInfo, pTcpConnection ); |
| case CFM_TCP_RESULT: | ||
| // we know TCP has succeeded, so keep using it | ||
| pendingServerList.insert ( InetAddr, CFM_TCP_REQUEST ); | ||
| ConnLessProtocol.CreateCLReqServerListMes ( InetAddr, PROTO_TCP_ONCE ); |



Short description of changes
Support fallback to TCP for protocol messages, in order to overcome potential loss of large messages due to UDP fragmentation.
Currently an incomplete draft, for comment as development continues.CHANGELOG: Client/Server: Support TCP fallback for protocol messages.
Context: Fixes an issue?
Discussed in issue #3242.
Does this change need documentation? What needs to be documented and how?
It will need documentation once design and development are complete. Particularly need to explain the firewall requirements for a server or directory.
Status of this Pull Request
Incomplete, still under development. Main server side complete and working. Client side development in progress.Complete and ready for review and testing.Still marked draft asit needs some of the debug messages to be commented out before merging.What is missing until this pull request can be merged?
A lot of testing of both server and client. Intended for Jamulus 4.0.0.
Checklist