some more fixes
This commit is contained in:
parent
7af781447d
commit
0f46659fcb
7 changed files with 1045 additions and 998 deletions
|
@ -188,10 +188,7 @@ bool CChannel::SetSockBufNumFrames ( const int iNewNumFrames,
|
||||||
// this would give us problems with different threads (e.g. the
|
// this would give us problems with different threads (e.g. the
|
||||||
// timer thread) and the protocol mechanism (problem with
|
// timer thread) and the protocol mechanism (problem with
|
||||||
// qRegisterMetaType(), etc.)
|
// qRegisterMetaType(), etc.)
|
||||||
|
emit ServerAutoSockBufSizeChange ( iNewNumFrames );
|
||||||
// TODO create new message, this one only works for client...
|
|
||||||
//emit ReqJittBufSize();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false; // -> no error
|
return false; // -> no error
|
||||||
|
@ -295,16 +292,24 @@ void CChannel::OnSendProtMessage ( CVector<uint8_t> vecMessage )
|
||||||
|
|
||||||
void CChannel::OnJittBufSizeChange ( int iNewJitBufSize )
|
void CChannel::OnJittBufSizeChange ( int iNewJitBufSize )
|
||||||
{
|
{
|
||||||
// first check for special case: auto setting
|
// for server apply setting, for client emit message
|
||||||
if ( iNewJitBufSize == AUTO_NET_BUF_SIZE_FOR_PROTOCOL )
|
if ( bIsServer )
|
||||||
{
|
{
|
||||||
SetDoAutoSockBufSize ( true );
|
// first check for special case: auto setting
|
||||||
|
if ( iNewJitBufSize == AUTO_NET_BUF_SIZE_FOR_PROTOCOL )
|
||||||
|
{
|
||||||
|
SetDoAutoSockBufSize ( true );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// manual setting is received, turn OFF auto setting and apply new value
|
||||||
|
SetDoAutoSockBufSize ( false );
|
||||||
|
SetSockBufNumFrames ( iNewJitBufSize, true );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// manual setting is received, turn OFF auto setting and apply new value
|
emit JittBufSizeChanged ( iNewJitBufSize );
|
||||||
SetDoAutoSockBufSize ( false );
|
|
||||||
SetSockBufNumFrames ( iNewJitBufSize, true );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,6 +183,8 @@ signals:
|
||||||
void MessReadyForSending ( CVector<uint8_t> vecMessage );
|
void MessReadyForSending ( CVector<uint8_t> vecMessage );
|
||||||
void NewConnection();
|
void NewConnection();
|
||||||
void ReqJittBufSize();
|
void ReqJittBufSize();
|
||||||
|
void JittBufSizeChanged ( int iNewJitBufSize );
|
||||||
|
void ServerAutoSockBufSizeChange ( int iNNumFra );
|
||||||
void ReqConnClientsList();
|
void ReqConnClientsList();
|
||||||
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
void ConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
||||||
void NameHasChanged();
|
void NameHasChanged();
|
||||||
|
|
1986
src/client.cpp
1986
src/client.cpp
File diff suppressed because it is too large
Load diff
|
@ -328,6 +328,7 @@ public slots:
|
||||||
void OnSendProtMessage ( CVector<uint8_t> vecMessage );
|
void OnSendProtMessage ( CVector<uint8_t> vecMessage );
|
||||||
void OnDetectedCLMessage ( CVector<uint8_t> vecbyData, int iNumBytes );
|
void OnDetectedCLMessage ( CVector<uint8_t> vecbyData, int iNumBytes );
|
||||||
void OnReqJittBufSize() { CreateServerJitterBufferMessage(); }
|
void OnReqJittBufSize() { CreateServerJitterBufferMessage(); }
|
||||||
|
void OnJittBufSizeChanged ( int iNewJitBufSize );
|
||||||
void OnReqChanName() { Channel.SetRemoteName ( strName ); }
|
void OnReqChanName() { Channel.SetRemoteName ( strName ); }
|
||||||
void OnNewConnection();
|
void OnNewConnection();
|
||||||
void OnCLPingReceived ( CHostAddress InetAddr,
|
void OnCLPingReceived ( CHostAddress InetAddr,
|
||||||
|
|
|
@ -116,7 +116,7 @@ LED bar: lbr
|
||||||
// minimum/maximum network buffer size (which can be chosen by slider)
|
// minimum/maximum network buffer size (which can be chosen by slider)
|
||||||
#define MIN_NET_BUF_SIZE_NUM_BL 1 // number of blocks
|
#define MIN_NET_BUF_SIZE_NUM_BL 1 // number of blocks
|
||||||
#define MAX_NET_BUF_SIZE_NUM_BL 20 // number of blocks
|
#define MAX_NET_BUF_SIZE_NUM_BL 20 // number of blocks
|
||||||
#define AUTO_NET_BUF_SIZE_FOR_PROTOCOL -1 // auto set parameter (only used for protocol)
|
#define AUTO_NET_BUF_SIZE_FOR_PROTOCOL ( MAX_NET_BUF_SIZE_NUM_BL + 1 ) // auto set parameter (only used for protocol)
|
||||||
|
|
||||||
// default network buffer size
|
// default network buffer size
|
||||||
#define DEF_NET_BUF_SIZE_NUM_BL 10 // number of blocks
|
#define DEF_NET_BUF_SIZE_NUM_BL 10 // number of blocks
|
||||||
|
|
|
@ -398,6 +398,20 @@ CServer::CServer ( const int iNewNumChan,
|
||||||
QObject::connect ( &vecChannels[9], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh9 ( QString ) ) );
|
QObject::connect ( &vecChannels[9], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh9 ( QString ) ) );
|
||||||
QObject::connect ( &vecChannels[10], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh10 ( QString ) ) );
|
QObject::connect ( &vecChannels[10], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh10 ( QString ) ) );
|
||||||
QObject::connect ( &vecChannels[11], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh11 ( QString ) ) );
|
QObject::connect ( &vecChannels[11], SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceivedCh11 ( QString ) ) );
|
||||||
|
|
||||||
|
// auto socket buffer size change
|
||||||
|
QObject::connect ( &vecChannels[0], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh0 ( int ) ) );
|
||||||
|
QObject::connect ( &vecChannels[1], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh1 ( int ) ) );
|
||||||
|
QObject::connect ( &vecChannels[2], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh2 ( int ) ) );
|
||||||
|
QObject::connect ( &vecChannels[3], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh3 ( int ) ) );
|
||||||
|
QObject::connect ( &vecChannels[4], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh4 ( int ) ) );
|
||||||
|
QObject::connect ( &vecChannels[5], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh5 ( int ) ) );
|
||||||
|
QObject::connect ( &vecChannels[6], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh6 ( int ) ) );
|
||||||
|
QObject::connect ( &vecChannels[7], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh7 ( int ) ) );
|
||||||
|
QObject::connect ( &vecChannels[8], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh8 ( int ) ) );
|
||||||
|
QObject::connect ( &vecChannels[9], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh9 ( int ) ) );
|
||||||
|
QObject::connect ( &vecChannels[10], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh10 ( int ) ) );
|
||||||
|
QObject::connect ( &vecChannels[11], SIGNAL ( ServerAutoSockBufSizeChange ( int ) ), this, SLOT ( OnServerAutoSockBufSizeChangeCh11 ( int ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CServer::OnSendProtMessage ( int iChID, CVector<uint8_t> vecMessage )
|
void CServer::OnSendProtMessage ( int iChID, CVector<uint8_t> vecMessage )
|
||||||
|
|
13
src/server.h
13
src/server.h
|
@ -369,6 +369,19 @@ public slots:
|
||||||
void OnChatTextReceivedCh9 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 9, strChatText ); }
|
void OnChatTextReceivedCh9 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 9, strChatText ); }
|
||||||
void OnChatTextReceivedCh10 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 10, strChatText ); }
|
void OnChatTextReceivedCh10 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 10, strChatText ); }
|
||||||
void OnChatTextReceivedCh11 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 11, strChatText ); }
|
void OnChatTextReceivedCh11 ( QString strChatText ) { CreateAndSendChatTextForAllConChannels ( 11, strChatText ); }
|
||||||
|
|
||||||
|
void OnServerAutoSockBufSizeChangeCh0 ( int iNNumFra ) { vecChannels[0].CreateJitBufMes ( iNNumFra ); }
|
||||||
|
void OnServerAutoSockBufSizeChangeCh1 ( int iNNumFra ) { vecChannels[1].CreateJitBufMes ( iNNumFra ); }
|
||||||
|
void OnServerAutoSockBufSizeChangeCh2 ( int iNNumFra ) { vecChannels[2].CreateJitBufMes ( iNNumFra ); }
|
||||||
|
void OnServerAutoSockBufSizeChangeCh3 ( int iNNumFra ) { vecChannels[3].CreateJitBufMes ( iNNumFra ); }
|
||||||
|
void OnServerAutoSockBufSizeChangeCh4 ( int iNNumFra ) { vecChannels[4].CreateJitBufMes ( iNNumFra ); }
|
||||||
|
void OnServerAutoSockBufSizeChangeCh5 ( int iNNumFra ) { vecChannels[5].CreateJitBufMes ( iNNumFra ); }
|
||||||
|
void OnServerAutoSockBufSizeChangeCh6 ( int iNNumFra ) { vecChannels[6].CreateJitBufMes ( iNNumFra ); }
|
||||||
|
void OnServerAutoSockBufSizeChangeCh7 ( int iNNumFra ) { vecChannels[7].CreateJitBufMes ( iNNumFra ); }
|
||||||
|
void OnServerAutoSockBufSizeChangeCh8 ( int iNNumFra ) { vecChannels[8].CreateJitBufMes ( iNNumFra ); }
|
||||||
|
void OnServerAutoSockBufSizeChangeCh9 ( int iNNumFra ) { vecChannels[9].CreateJitBufMes ( iNNumFra ); }
|
||||||
|
void OnServerAutoSockBufSizeChangeCh10 ( int iNNumFra ) { vecChannels[10].CreateJitBufMes ( iNNumFra ); }
|
||||||
|
void OnServerAutoSockBufSizeChangeCh11 ( int iNNumFra ) { vecChannels[11].CreateJitBufMes ( iNNumFra ); }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* !defined ( SERVER_HOIHGE7LOKIH83JH8_3_43445KJIUHF1912__INCLUDED_ ) */
|
#endif /* !defined ( SERVER_HOIHGE7LOKIH83JH8_3_43445KJIUHF1912__INCLUDED_ ) */
|
||||||
|
|
Loading…
Reference in a new issue