summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorStephane Letz <letz@grame.fr>2011-07-30 10:51:18 +0200
committerStephane Letz <letz@grame.fr>2011-07-30 10:51:18 +0200
commit80d316ece46717f3634c5466e499b2d11fceb209 (patch)
tree8b7b0913274e3cd06202f186b9624b9e9e2092d4 /windows
parent4e979b964966b6596eb725916f9ff16932e85880 (diff)
parent7918f1c12abdd8d9328b829a87f9ae3a414344b5 (diff)
downloadjack2-80d316ece46717f3634c5466e499b2d11fceb209.tar.gz
Merge branch 'master' into js-dbus
Diffstat (limited to 'windows')
-rw-r--r--windows/JackWinNamedPipeClientChannel.cpp22
-rw-r--r--windows/JackWinNamedPipeClientChannel.h2
-rw-r--r--windows/JackWinNamedPipeServerChannel.cpp11
-rw-r--r--windows/libjackserver.cbp1
4 files changed, 22 insertions, 14 deletions
diff --git a/windows/JackWinNamedPipeClientChannel.cpp b/windows/JackWinNamedPipeClientChannel.cpp
index e866e80d..9bf5d0b9 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 a60c826a..b557a33c 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;
}
@@ -477,11 +480,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();
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 @@
<Unit filename="..\common\JackActivationCount.cpp" />
<Unit filename="..\common\JackArgParser.cpp" />
<Unit filename="..\common\JackAudioDriver.cpp" />
+ <Unit filename="..\common\JackTimedDriver.cpp" />
<Unit filename="..\common\JackAudioPort.cpp" />
<Unit filename="..\common\JackClient.cpp" />
<Unit filename="..\common\JackConnectionManager.cpp" />