Repository navigation
Support TCP for protocol messages #3636
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
Open
softins
wants to merge
37
commits into
jamulussoftware:main
Choose a base branch
from
softins:tcp-protocol
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,576
−89
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
1ab9f05
Add TCP handling for Server and Client
softins 2a72e5c
Add some debug messages
softins 6c90dc7
Some fixes recommended by AI review
softins 735a824
Use separate TCP sockets for IPv4 and IPv6
softins ad5757a
Add a channel token for use by server channels.
softins ac9765c
Use channel token to authenticate a long TCP connection
softins 03ab070
Add operator!= for CHostAddress for completeness
softins f7296eb
Check that CLM_TCP_SUPPORTED for client ID comes from the connected s…
softins 38b5d3d
Only offer TCP mode if the listener started ok
softins 9bf4f60
Handle unlikely situation where new TCP connection replaces old
softins d065fac
Log Error or EOF from TCP socket read
softins 6a41444
Update docs/TCP.md to include the channel token for TCP session authe…
softins f058473
Minor change to OnReadyRead()
softins 4969fb5
Empty pending hashes when opening connect dialog
softins d1d9678
Minor updates from review
softins 79a1e74
Do not log the channel token
softins 752b02b
Improvements from AI review
softins f50c936
Change "TCP supported" to "TCP offered"
softins 46713d5
Updates to TCP.md
softins dceb26d
Remove debug messages in preparation for production
softins f5f0e52
Formatting fixes
softins 43e9491
Make message ID available to CL sending functions
softins bd0ea9d
Revert to UDP properly if TCP connection fails
softins 4b6f9ae
Reset TCP session state in CClient::Stop()
softins ab7d8c8
Add docs/TCP.md to DISTFILES
softins c387154
Improvements to docs/TCP.md after review
softins 95df900
Remove unused CFM_UDP_RESULT from fetch modes
softins 506f6f5
Remove noisy retry warnings
softins d812338
Reset fetch mode on aborted TCP connection
softins c14cb92
Remove temporary debug messages
softins 829bd81
Corrections to TCP.md following review
softins 4376525
In TCP.md, remove mention of large welcome message.
softins 72ac621
Update TCP.md in response to review
softins a2ad764
Revert "In TCP.md, remove mention of large welcome message."
softins 732d01d
Add clarification about welcome text and split messages
softins cac4408
Remove unused signal CClient::CLTcpOfferedReceived
softins 99c66a4
Add clarification of potential welcome message size
softins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,7 @@ | |
|
|
||
| // CChannel implementation ***************************************************** | ||
| CChannel::CChannel ( const bool bNIsServer ) : | ||
| pTcpConnection ( nullptr ), | ||
| vecfGains ( MAX_NUM_CHANNELS, 1.0f ), | ||
| vecfPannings ( MAX_NUM_CHANNELS, 0.5f ), | ||
| iCurSockBufNumFrames ( INVALID_INDEX ), | ||
|
|
@@ -59,6 +60,7 @@ CChannel::CChannel ( const bool bNIsServer ) : | |
| bIsEnabled ( false ), | ||
| bIsServer ( bNIsServer ), | ||
| bIsIdentified ( false ), | ||
| iChannelToken ( 0 ), | ||
| iAudioFrameSizeSamples ( DOUBLE_SYSTEM_FRAME_SIZE_SAMPLES ), | ||
| SignalLevelMeter ( false, 0.5 ) // server mode with mono out and faster smoothing | ||
| { | ||
|
|
@@ -103,7 +105,7 @@ CChannel::CChannel ( const bool bNIsServer ) : | |
|
|
||
| QObject::connect ( &Protocol, &CProtocol::ChangeChanPan, this, &CChannel::OnChangeChanPan ); | ||
|
|
||
| QObject::connect ( &Protocol, &CProtocol::ClientIDReceived, this, &CChannel::ClientIDReceived ); | ||
| QObject::connect ( &Protocol, &CProtocol::ClientIDReceived, this, &CChannel::OnClientIDReceived ); | ||
|
|
||
| QObject::connect ( &Protocol, &CProtocol::RawAudioSupported, this, &CChannel::RawAudioSupported ); | ||
|
|
||
|
|
@@ -762,3 +764,28 @@ void CChannel::UpdateSocketBufferSize() | |
| SetSockBufNumFrames ( SockBuf.GetAutoSetting(), true ); | ||
| } | ||
| } | ||
|
|
||
| void CChannel::OnClientIDReceived ( int iChanID ) { emit ClientIDReceived ( iChanID ); } | ||
|
|
||
| void CChannel::CreateConClientListMes ( const CVector<CChannelInfo>& vecChanInfo, CProtocol& ConnLessProtocol ) | ||
| { | ||
| if ( pTcpConnection ) | ||
| { | ||
| ConnLessProtocol.CreateCLConnClientsListMes ( InetAddr, vecChanInfo, pTcpConnection ); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should make clear why the connectionless protocol is used here - I suppose since TCP handles the session, it's enough.
Comment on lines
+772
to
+774
|
||
| } | ||
| else | ||
| { | ||
| Protocol.CreateConClientListMes ( vecChanInfo ); | ||
| } | ||
| } | ||
|
|
||
| void CChannel::SetTcpConnection ( CTcpConnection* pConnection ) | ||
| { | ||
| if ( pTcpConnection ) | ||
| { | ||
| // this should never happen, but handle it if it does | ||
| pTcpConnection->disconnectFromHost(); | ||
| } | ||
|
|
||
| pTcpConnection = pConnection; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.