Commit 38a671d5 authored by sletz's avatar sletz
Browse files

Check MASTER <<==> SLAVE network protocol coherency.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3277 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 8bc654e5
......@@ -569,7 +569,7 @@ namespace Jack
//set the parameters to send
strcpy ( fParams.fPacketType, "params" );
fParams.fProtocolVersion = 'a';
fParams.fProtocolVersion = SLAVE_PROTOCOL;
SetPacketType ( &fParams, SLAVE_AVAILABLE );
//init loop : get a master and start, do it until connection is ok
......
......@@ -633,6 +633,12 @@ namespace Jack
JackNetMaster* JackNetMasterManager::MasterInit ( session_params_t& params )
{
jack_log ( "JackNetMasterManager::MasterInit, Slave : %s", params.fName );
//check MASTER <<==> SLAVE network protocol coherency
if (params.fProtocolVersion != MASTER_PROTOCOL) {
jack_error ( "Error : slave is running with a different protocol %s", params.fName );
return NULL;
}
//settings
fSocket.GetName ( params.fMasterNetName );
......
......@@ -272,7 +272,7 @@ namespace Jack
}
jack_info ( "**************** Network parameters ****************" );
jack_info ( "Name : %s", params->fName );
jack_info ( "Protocol revision : %c", params->fProtocolVersion );
jack_info ( "Protocol revision : %d", params->fProtocolVersion );
jack_info ( "MTU : %u", params->fMtu );
jack_info ( "Master name : %s", params->fMasterNetName );
jack_info ( "Slave name : %s", params->fSlaveNetName );
......
......@@ -55,6 +55,9 @@ namespace Jack
Data encoding : headers (session_params and packet_header) are encoded using HTN kind of functions but float data
are kept in LITTLE_ENDIAN format (to avoid 2 conversions in the more common LITTLE_ENDIAN <==> LITTLE_ENDIAN connection case).
*/
#define MASTER_PROTOCOL 1
#define SLAVE_PROTOCOL 1
struct _session_params
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment