git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2394 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.90
@@ -36,7 +36,6 @@ enum NotificationType { | |||||
kPortConnectCallback = 10, | kPortConnectCallback = 10, | ||||
kPortDisconnectCallback = 11, | kPortDisconnectCallback = 11, | ||||
kRealTimeCallback = 12, | kRealTimeCallback = 12, | ||||
kDeadClient = 13, | |||||
kMaxNotification | kMaxNotification | ||||
}; | }; | ||||
@@ -253,7 +253,7 @@ int JackServer::SetFreewheel(bool onoff) | |||||
} | } | ||||
} | } | ||||
// Coming from the RT thread or server channel | |||||
// Coming from the RT thread | |||||
void JackServer::Notify(int refnum, int notify, int value) | void JackServer::Notify(int refnum, int notify, int value) | ||||
{ | { | ||||
switch (notify) { | switch (notify) { | ||||
@@ -266,12 +266,15 @@ void JackServer::Notify(int refnum, int notify, int value) | |||||
fEngine->NotifyXRun(refnum); | fEngine->NotifyXRun(refnum); | ||||
break; | break; | ||||
case kDeadClient: | |||||
jack_log("JackServer: kDeadClient ref = %ld", refnum); | |||||
if (fEngine->ClientDeactivate(refnum) < 0) | |||||
jack_error("JackServer: DeadClient ref = %ld cannot be removed from the graph !!", refnum); | |||||
fEngine->ClientExternalClose(refnum); | |||||
break; | |||||
} | |||||
} | |||||
void JackServer::DeadClient(int refnum) | |||||
{ | |||||
jack_log("JackServer::DeadClient ref = %ld", refnum); | |||||
if (fEngine->ClientDeactivate(refnum) < 0) { | |||||
jack_error("JackServer::DeadClient ref = %ld cannot be removed from the graph !!", refnum); | |||||
fEngine->ClientExternalClose(refnum); | |||||
} | } | ||||
} | } | ||||
@@ -72,11 +72,14 @@ class EXPORT JackServer : private detail::JackGlobalsServerInitializer | |||||
int Start(); | int Start(); | ||||
int Stop(); | int Stop(); | ||||
int SetBufferSize(jack_nframes_t buffer_size); | |||||
int SetFreewheel(bool onoff); | |||||
// RT thread | |||||
void Notify(int refnum, int notify, int value); | void Notify(int refnum, int notify, int value); | ||||
// Command thread : API | |||||
int SetBufferSize(jack_nframes_t buffer_size); | |||||
int SetFreewheel(bool onoff); | |||||
int InternalClientLoad(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int* status); | int InternalClientLoad(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int* status); | ||||
void DeadClient(int refnum); | |||||
// Transport management | // Transport management | ||||
int ReleaseTimebase(int refnum); | int ReleaseTimebase(int refnum); | ||||
@@ -126,7 +126,7 @@ void JackSocketServerChannel::ClientKill(int fd) | |||||
if (refnum == -1) { // Should never happen... correspond to a client that started the socket but never opened... | if (refnum == -1) { // Should never happen... correspond to a client that started the socket but never opened... | ||||
jack_log("Client was not opened : probably correspond to server_check"); | jack_log("Client was not opened : probably correspond to server_check"); | ||||
} else { | } else { | ||||
fServer->Notify(refnum, kDeadClient, 0); | |||||
fServer->DeadClient(refnum); | |||||
} | } | ||||
fSocketTable.erase(fd); | fSocketTable.erase(fd); | ||||
@@ -122,7 +122,7 @@ void JackMachServerChannel::ClientKill(mach_port_t private_port) | |||||
jack_log("JackMachServerChannel::ClientKill"); | jack_log("JackMachServerChannel::ClientKill"); | ||||
int refnum = fClientTable[private_port]; | int refnum = fClientTable[private_port]; | ||||
assert(refnum > 0); | assert(refnum > 0); | ||||
fServer->Notify(refnum, kDeadClient, 0); | |||||
fServer->DeadClient(refnum); | |||||
fClientTable.erase(private_port); | fClientTable.erase(private_port); | ||||
// Hum, hum.... | // Hum, hum.... | ||||
@@ -344,7 +344,7 @@ void JackClientPipeThread::ClientKill() | |||||
} else if (fRefNum == 0) { // Correspond to a still not opened client. | } else if (fRefNum == 0) { // Correspond to a still not opened client. | ||||
jack_log("Kill a not opened client"); | jack_log("Kill a not opened client"); | ||||
} else { | } else { | ||||
fServer->Notify(fRefNum, kDeadClient, 0); | |||||
fServer->DeadClient(fRefNum); | |||||
} | } | ||||
Close(); | Close(); | ||||