From f62f984b97613807c8c75ef9358b00b96cec48ff Mon Sep 17 00:00:00 2001 From: Stephane Letz Date: Sat, 23 Jul 2011 12:11:29 +0200 Subject: Possible fix for http://trac.jackaudio.org/ticket/193. --- windows/JackWinNamedPipeClientChannel.cpp | 22 +++++++++++++--------- windows/JackWinNamedPipeClientChannel.h | 2 +- windows/JackWinNamedPipeServerChannel.cpp | 11 +++++++---- 3 files changed, 21 insertions(+), 14 deletions(-) (limited to 'windows') diff --git a/windows/JackWinNamedPipeClientChannel.cpp b/windows/JackWinNamedPipeClientChannel.cpp index f29f7ff5..e4b6ecb4 100644 --- a/windows/JackWinNamedPipeClientChannel.cpp +++ b/windows/JackWinNamedPipeClientChannel.cpp @@ -55,10 +55,10 @@ int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* nam /* 16/08/07: was called before doing "fRequestPipe.Connect" .... still necessary? - if (fNotificationListenPipe.Bind(jack_client_dir, name, 0) < 0) { - jack_error("Cannot bind pipe"); - goto error; - } + if (fNotificationListenPipe.Bind(jack_client_dir, name, 0) < 0) { + jack_error("Cannot bind pipe"); + goto error; + } */ if (fRequestPipe.Connect(jack_server_dir, server_name, 0) < 0) { @@ -67,10 +67,14 @@ int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* nam } // Check name in server - ClientCheck(name, uuid, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result); + ClientCheck(name, uuid, name_res, JACK_PROTOCOL_VERSION, (int)options, (int*)status, &result, true); if (result < 0) { - jack_error("Client name = %s conflits with another running client", name); - goto error; + int status1 = *status; + if (status1 & JackVersionError) { + jack_error("JACK protocol mismatch %d", JACK_PROTOCOL_VERSION); + } else { + jack_error("Client name = %s conflits with another running client", name); + } } if (fNotificationListenPipe.Bind(jack_client_dir, name_res, 0) < 0) { @@ -142,9 +146,9 @@ void JackWinNamedPipeClientChannel::ServerAsyncCall(JackRequest* req, JackResult } } -void JackWinNamedPipeClientChannel::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result) +void JackWinNamedPipeClientChannel::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open) { - JackClientCheckRequest req(name, protocol, options, uuid); + JackClientCheckRequest req(name, protocol, options, uuid, open); JackClientCheckResult res; ServerSyncCall(&req, &res, result); *status = res.fStatus; diff --git a/windows/JackWinNamedPipeClientChannel.h b/windows/JackWinNamedPipeClientChannel.h index 479e3271..7b84eba8 100644 --- a/windows/JackWinNamedPipeClientChannel.h +++ b/windows/JackWinNamedPipeClientChannel.h @@ -59,7 +59,7 @@ class JackWinNamedPipeClientChannel : public detail::JackClientChannelInterface, int ServerCheck(const char* server_name); - void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result); + void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open); void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result); void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result) {} diff --git a/windows/JackWinNamedPipeServerChannel.cpp b/windows/JackWinNamedPipeServerChannel.cpp index de2fd397..75fa7d27 100644 --- a/windows/JackWinNamedPipeServerChannel.cpp +++ b/windows/JackWinNamedPipeServerChannel.cpp @@ -117,6 +117,9 @@ bool JackClientPipeThread::HandleRequest() if (req.Read(fPipe) == 0) res.fResult = fServer->GetEngine()->ClientCheck(req.fName, req.fUUID, res.fName, req.fProtocol, req.fOptions, &res.fStatus); res.Write(fPipe); + // Atomic ClientCheck followed by ClientOpen on same pipe + if (req.fOpen) + HandleRequest(); break; } @@ -478,11 +481,11 @@ int JackWinNamedPipeServerChannel::Open(const char* server_name, JackServer* ser void JackWinNamedPipeServerChannel::Close() { /* TODO : solve WIN32 thread Kill issue - This would hang the server... since we are quitting it, its not really problematic, - all ressources will be deallocated at the end. + This would hang the server... since we are quitting it, its not really problematic, + all ressources will be deallocated at the end. - fRequestListenPipe.Close(); - fThread.Stop(); + fRequestListenPipe.Close(); + fThread.Stop(); */ fThread.Kill(); -- cgit v1.2.1 From 5a5cc73ac7daea336681f300382926a56b2fb813 Mon Sep 17 00:00:00 2001 From: sletz Date: Fri, 29 Jul 2011 14:55:00 +0000 Subject: New JackTimedDriver class to be used by JackDummyDriver, JackNetDriver and JackNetOneDriver classes. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4522 0c269be4-1314-0410-8aa9-9f06e86f4224 --- windows/libjackserver.cbp | 1 + 1 file changed, 1 insertion(+) (limited to 'windows') diff --git a/windows/libjackserver.cbp b/windows/libjackserver.cbp index d2f9b490..17f64965 100644 --- a/windows/libjackserver.cbp +++ b/windows/libjackserver.cbp @@ -241,6 +241,7 @@ + -- cgit v1.2.1