Browse Source

Add InitConnection and InitRendering methods in JackNetSlaveInterface, better packet type checking in JackNetSlaveInterface::SyncRecv.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3329 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.2
sletz 16 years ago
parent
commit
8b0e453d73
3 changed files with 50 additions and 1 deletions
  1. +4
    -0
      ChangeLog
  2. +44
    -1
      common/JackNetInterface.cpp
  3. +2
    -0
      common/JackNetInterface.h

+ 4
- 0
ChangeLog View File

@@ -22,6 +22,10 @@ Michael Voigt
---------------------------
Jackdmp changes log
---------------------------

2009-02-20 Stephane Letz <letz@grame.fr>
* Add InitConnection and InitRendering methods in JackNetSlaveInterface, better packet type checking in JackNetSlaveInterface::SyncRecv.
2009-02-17 Stephane Letz <letz@grame.fr>


+ 44
- 1
common/JackNetInterface.cpp View File

@@ -597,6 +597,48 @@ namespace Jack

return true;
}
// Separate the connection protocol into two separated step
bool JackNetSlaveInterface::InitConnection()
{
jack_log ( "JackNetSlaveInterface::InitConnection()" );

//set the parameters to send
strcpy (fParams.fPacketType, "params");
fParams.fProtocolVersion = SLAVE_PROTOCOL;
SetPacketType (&fParams, SLAVE_AVAILABLE);

net_status_t status;
do
{
//get a master
status = GetNetMaster();
if (status == NET_SOCKET_ERROR)
return false;
}
while (status != NET_CONNECTED);
return true;
}
bool JackNetSlaveInterface::InitRendering()
{
jack_log("JackNetSlaveInterface::InitRendering()");

net_status_t status;
do
{
//then tell the master we are ready
jack_info("Initializing connection with %s...", fParams.fMasterNetName);
status = SendStartToMaster();
if (status == NET_ERROR)
return false;
}
while (status != NET_ROLLING);
return true;
}

net_status_t JackNetSlaveInterface::GetNetMaster()
{
@@ -760,7 +802,8 @@ namespace Jack
if ( rx_bytes == SOCKET_ERROR )
return rx_bytes;
}
while ( !rx_bytes && ( rx_head->fDataType != 's' ) );
while ((strcmp(rx_head->fPacketType, "header") != 0) && (rx_head->fDataType != 's'));
fRxHeader.fIsLastPckt = rx_head->fIsLastPckt;
return rx_bytes;
}


+ 2
- 0
common/JackNetInterface.h View File

@@ -140,6 +140,8 @@ namespace Jack
net_transport_data_t fReturnTransportData;

bool Init();
bool InitConnection();
bool InitRendering();
net_status_t GetNetMaster();
net_status_t SendStartToMaster();


Loading…
Cancel
Save