Skip to content
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

Split messages #582

Merged
merged 14 commits into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

- added a command line argument to enable multithreading in the server (#339)

- added support for split protocol messages (fixes bug with large number of clients
connected to a server, #547)

- store recorder settings, coded by pljones (#313)

- accessibility improvements, coded by chigkim (#498, #512)
Expand Down
16 changes: 16 additions & 0 deletions src/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ qRegisterMetaType<CHostAddress> ( "CHostAddress" );
QObject::connect ( &Protocol, &CProtocol::ReqNetTranspProps,
this, &CChannel::OnReqNetTranspProps );

QObject::connect ( &Protocol, &CProtocol::ReqSplitMessSupport,
this, &CChannel::OnReqSplitMessSupport );

QObject::connect ( &Protocol, &CProtocol::SplitMessSupported,
this, &CChannel::OnSplitMessSupported );

QObject::connect ( &Protocol, &CProtocol::LicenceRequired,
this, &CChannel::LicenceRequired );

Expand Down Expand Up @@ -470,6 +476,13 @@ void CChannel::OnReqNetTranspProps()
Protocol.CreateNetwTranspPropsMes ( GetNetworkTransportPropsFromCurrentSettings() );
}

void CChannel::OnReqSplitMessSupport()
{
// activate split messages in our protocol (client) and return answer message to the server
Protocol.SetSplitMessageSupported ( true );
Protocol.CreateSplitMessSupportedMes();
}

CNetworkTransportProps CChannel::GetNetworkTransportPropsFromCurrentSettings()
{
// use current stored settings of the channel to fill the network transport
Expand Down Expand Up @@ -641,6 +654,9 @@ EGetDataStat CChannel::GetData ( CVector<uint8_t>& vecbyData,
// in case we are just disconnected, we have to fire a message
if ( eGetStatus == GS_CHAN_NOW_DISCONNECTED )
{
// reset the protocol
Protocol.Reset();

// emit message
emit Disconnected();
}
Expand Down
3 changes: 3 additions & 0 deletions src/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class CChannel : public QObject
}
void CreateClientIDMes ( const int iChanID ) { Protocol.CreateClientIDMes ( iChanID ); }
void CreateReqNetwTranspPropsMes() { Protocol.CreateReqNetwTranspPropsMes(); }
void CreateReqSplitMessSupportMes() { Protocol.CreateReqSplitMessSupportMes(); }
void CreateReqJitBufMes() { Protocol.CreateReqJitBufMes(); }
void CreateReqConnClientsList() { Protocol.CreateReqConnClientsList(); }
void CreateChatTextMes ( const QString& strChatText ) { Protocol.CreateChatTextMes ( strChatText ); }
Expand Down Expand Up @@ -245,6 +246,8 @@ public slots:
void OnChangeChanInfo ( CChannelCoreInfo ChanInfo );
void OnNetTranspPropsReceived ( CNetworkTransportProps NetworkTransportProps );
void OnReqNetTranspProps();
void OnReqSplitMessSupport();
void OnSplitMessSupported() { Protocol.SetSplitMessageSupported ( true ); }

void OnParseMessageBody ( CVector<uint8_t> vecbyMesBodyData,
int iRecCounter,
Expand Down
Loading