-
Notifications
You must be signed in to change notification settings - Fork 247
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
d3d653f
Add TCP handling for Server and Client
softins 84d36ed
Add some debug messages
softins bac987c
Some fixes recommended by AI review
softins 97c79f5
Use separate TCP sockets for IPv4 and IPv6
softins b301811
Add a channel token for use by server channels.
softins 9179136
Use channel token to authenticate a long TCP connection
softins bc81d88
Add operator!= for CHostAddress for completeness
softins 91a6e11
Check that CLM_TCP_SUPPORTED for client ID comes from the connected s…
softins f47eec7
Only offer TCP mode if the listener started ok
softins 0cc9b7c
Handle unlikely situation where new TCP connection replaces old
softins c2aa936
Log Error or EOF from TCP socket read
softins b23ee9f
Update docs/TCP.md to include the channel token for TCP session authe…
softins 12007c6
Minor change to OnReadyRead()
softins 3281ece
Empty pending hashes when opening connect dialog
softins f77a7a0
Minor updates from review
softins e9f31fd
Do not log the channel token
softins c280106
Improvements from AI review
softins 554fd72
Change "TCP supported" to "TCP offered"
softins 473cb32
Updates to TCP.md
softins 19fe97e
Remove debug messages in preparation for production
softins 9580546
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 ); | ||
|
|
||
|
|
@@ -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. |
||
| } | ||
| 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.