-
Notifications
You must be signed in to change notification settings - Fork 248
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.
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
6104b5c
Add TCP handling for Server and Client
softins 8e58ec6
Add some debug messages
softins d900ae3
Some fixes recommended by AI review
softins 5aec70c
Use separate TCP sockets for IPv4 and IPv6
softins fbce28a
Add a channel token for use by server channels.
softins 11851cd
Use channel token to authenticate a long TCP connection
softins 156d2cd
Add operator!= for CHostAddress for completeness
softins b378a0c
Check that CLM_TCP_SUPPORTED for client ID comes from the connected s…
softins 411831b
Only offer TCP mode if the listener started ok
softins a5f9e1b
Handle unlikely situation where new TCP connection replaces old
softins 768d1f1
Log Error or EOF from TCP socket read
softins 1c776fd
Update docs/TCP.md to include the channel token for TCP session authe…
softins 63eefd9
Minor change to OnReadyRead()
softins 0e577a4
Empty pending hashes when opening connect dialog
softins 13a2a11
Minor updates from review
softins bf78aba
Do not log the channel token
softins e774d7c
Improvements from AI review
softins b7bf333
Change "TCP supported" to "TCP offered"
softins 3f43aac
Updates to TCP.md
softins 629e43d
Remove debug messages in preparation for production
softins bd2bdc1
Formatting fixes
softins 16c8dcb
Make message ID available to CL sending functions
softins ab19fdc
Revert to UDP properly if TCP connection fails
softins 6b737c2
Reset TCP session state in CClient::Stop()
softins 6e97ff0
Add docs/TCP.md to DISTFILES
softins 2010dc5
Improvements to docs/TCP.md after review
softins 19f79ce
Remove unused CFM_UDP_RESULT from fetch modes
softins 589ebf8
Remove noisy retry warnings
softins 1e763a4
Reset fetch mode on aborted TCP connection
softins e87dcd6
Remove temporary debug messages
softins 56c9631
Corrections to TCP.md following review
softins e8e4a10
In TCP.md, remove mention of large welcome message.
softins adc4ee3
Update TCP.md in response to review
softins c69a8e3
Revert "In TCP.md, remove mention of large welcome message."
softins ef101db
Add clarification about welcome text and split messages
softins 520f19c
Remove unused signal CClient::CLTcpOfferedReceived
softins 05aaf0a
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 ); | ||
|
|
||
|
|
@@ -764,3 +766,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
+774
to
+776
|
||
| } | ||
| 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.