diff --git a/common/JackNetInterface.cpp b/common/JackNetInterface.cpp index deffcae5..eaf9cae4 100644 --- a/common/JackNetInterface.cpp +++ b/common/JackNetInterface.cpp @@ -867,8 +867,7 @@ namespace Jack jack_error("No data, is the master still running ?"); //if a network error occurs, this exception will restart the driver } else if (error == NET_CONN_ERROR) { - jack_error("Recv connection lost"); - throw JackNetException(); + FatalError(); } else { jack_error("Fatal error in slave receive : %s", StrError(NET_ERROR_CODE)); } @@ -879,6 +878,12 @@ namespace Jack return rx_bytes; } + void JackNetSlaveInterface::FatalError() + { + jack_error("Send connection lost"); + throw JackNetException(); + } + int JackNetSlaveInterface::Send(size_t size, int flags) { packet_header_t* header = reinterpret_cast(fTxBuffer); @@ -890,8 +895,7 @@ namespace Jack net_error_t error = fSocket.GetError(); //if a network error occurs, this exception will restart the driver if (error == NET_CONN_ERROR) { - jack_error("Send connection lost"); - throw JackNetException(); + FatalError(); } else { jack_error("Fatal error in slave send : %s", StrError(NET_ERROR_CODE)); } diff --git a/common/JackNetInterface.h b/common/JackNetInterface.h index 5ecdcbab..88f5b400 100644 --- a/common/JackNetInterface.h +++ b/common/JackNetInterface.h @@ -81,12 +81,14 @@ namespace Jack virtual int DataRecv() = 0; virtual int DataSend() = 0; - virtual int Send ( size_t size, int flags ) = 0; - virtual int Recv ( size_t size, int flags ) = 0; + virtual int Send(size_t size, int flags) = 0; + virtual int Recv(size_t size, int flags) = 0; + + virtual void FatalError() = 0; JackNetInterface(); - JackNetInterface ( const char* multicast_ip, int port ); - JackNetInterface ( session_params_t& params, JackNetSocket& socket, const char* multicast_ip ); + JackNetInterface(const char* multicast_ip, int port); + JackNetInterface(session_params_t& params, JackNetSocket& socket, const char* multicast_ip); public: @@ -173,6 +175,8 @@ namespace Jack int Recv ( size_t size, int flags ); int Send ( size_t size, int flags ); + void FatalError(); + public: JackNetSlaveInterface() : JackNetInterface()