-
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
21
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
21 commits
Select commit
Hold shift + click to select a range
7b6fff4
Add TCP handling for Server and Client
softins 3f8ebf3
Add some debug messages
softins 76070ac
Some fixes recommended by AI review
softins 223fc4b
Use separate TCP sockets for IPv4 and IPv6
softins d7b80ff
Add a channel token for use by server channels.
softins 09c1d04
Use channel token to authenticate a long TCP connection
softins 58291ca
Add operator!= for CHostAddress for completeness
softins cab2e76
Check that CLM_TCP_SUPPORTED for client ID comes from the connected s…
softins 1ec5463
Only offer TCP mode if the listener started ok
softins 3b915f1
Handle unlikely situation where new TCP connection replaces old
softins c0ad940
Log Error or EOF from TCP socket read
softins bafe0cb
Update docs/TCP.md to include the channel token for TCP session authe…
softins 95cba3f
Minor change to OnReadyRead()
softins 9bdb90b
Empty pending hashes when opening connect dialog
softins 9c67aa7
Minor updates from review
softins 8ad1375
Do not log the channel token
softins ea33ac1
Improvements from AI review
softins 1d1b3b7
Change "TCP supported" to "TCP offered"
softins d0b4fe3
Updates to TCP.md
softins 5c4f897
Remove debug messages in preparation for production
softins aa41c31
Formatting fixes
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 ); | ||
|
|
||
|
|
@@ -737,3 +739,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. |
||
| } | ||
| 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.