Browse Source

More precise debug messages.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4769 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.9.5
sletz 13 years ago
parent
commit
5ce3629307
4 changed files with 12 additions and 18 deletions
  1. +4
    -2
      posix/JackSocket.cpp
  2. +4
    -5
      posix/JackSocketServerChannel.cpp
  3. +2
    -6
      posix/JackSocketServerNotifyChannel.cpp
  4. +2
    -5
      windows/JackWinNamedPipeServerNotifyChannel.cpp

+ 4
- 2
posix/JackSocket.cpp View File

@@ -186,7 +186,8 @@ int JackClientSocket::Read(void* data, int len)
return 0; // For a non blocking socket, a read failure is not considered as an error
} else if (res != 0) {
jack_error("Cannot read socket fd = %d err = %s", fSocket, strerror(errno));
return 0;
//return 0;
return -1;
} else {
jack_error("Cannot read socket fd = %d err = %s", fSocket, strerror(errno));
return -1;
@@ -231,7 +232,8 @@ int JackClientSocket::Write(void* data, int len)
return 0; // For a non blocking socket, a write failure is not considered as an error
} else if (res != 0) {
jack_error("Cannot write socket fd = %ld err = %s", fSocket, strerror(errno));
return 0;
//return 0;
return -1;
} else {
jack_error("Cannot write socket fd = %ld err = %s", fSocket, strerror(errno));
return -1;


+ 4
- 5
posix/JackSocketServerChannel.cpp View File

@@ -128,7 +128,6 @@ int JackSocketServerChannel::GetFd(JackClientSocket* socket_aux)

void JackSocketServerChannel::ClientAdd(detail::JackChannelTransactionInterface* socket_aux, JackClientOpenRequest* req, JackClientOpenResult *res)
{
jack_log("JackSocketServerChannel::ClientAdd");
int refnum = -1;
res->fResult = fServer->GetEngine()->ClientExternalOpen(req->fName, req->fPID, req->fUUID, &refnum, &res->fSharedEngine, &res->fSharedClient, &res->fSharedGraph);
if (res->fResult == 0) {
@@ -138,6 +137,7 @@ void JackSocketServerChannel::ClientAdd(detail::JackChannelTransactionInterface*
assert(fd >= 0);
fSocketTable[fd].first = refnum;
fRebuild = true;
jack_log("JackSocketServerChannel::ClientAdd ref = %d fd = %d", refnum, fd);
#ifdef __APPLE__
int on = 1;
if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, (const char*)&on, sizeof(on)) < 0) {
@@ -156,7 +156,7 @@ void JackSocketServerChannel::ClientRemove(detail::JackChannelTransactionInterfa
int fd = GetFd(socket);
assert(fd >= 0);

jack_log("JackSocketServerChannel::ClientRemove ref = %d", refnum);
jack_log("JackSocketServerChannel::ClientRemove ref = %d fd = %d", refnum, fd);
fSocketTable.erase(fd);
socket->Close();
delete socket;
@@ -168,16 +168,15 @@ void JackSocketServerChannel::ClientKill(int fd)
pair<int, JackClientSocket*> elem = fSocketTable[fd];
JackClientSocket* socket = elem.second;
int refnum = elem.first;

assert(socket);
jack_log("JackSocketServerChannel::ClientKill ref = %d", refnum);

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");
} else {
fServer->ClientKill(refnum);
}

jack_log("JackSocketServerChannel::ClientKill ref = %d fd = %d", refnum, fd);
fSocketTable.erase(fd);
socket->Close();
delete socket;


+ 2
- 6
posix/JackSocketServerNotifyChannel.cpp View File

@@ -54,19 +54,15 @@ void JackSocketServerNotifyChannel::Notify(int refnum, int notify, int value)
{
JackClientNotificationRequest req(refnum, notify, value);
if (req.Write(&fRequestSocket) < 0) {
jack_error("Could not write request ref = %d notify = %d", refnum, notify);
jack_error("Could not write notification ref = %d notify = %d", refnum, notify);
}
}

void JackSocketServerNotifyChannel::NotifyQuit()
{
JackClientNotificationRequest req(-1, kQUIT, 0);
if (req.Write(&fRequestSocket) < 0) {
jack_error("Could not write request ref = %d notify = %d", -1, kQUIT);
}
Notify(-1, kQUIT, 0);
}


} // end of namespace



+ 2
- 5
windows/JackWinNamedPipeServerNotifyChannel.cpp View File

@@ -51,16 +51,13 @@ void JackWinNamedPipeServerNotifyChannel::Notify(int refnum, int notify, int val
{
JackClientNotificationRequest req(refnum, notify, value);
if (req.Write(&fRequestPipe) < 0) {
jack_error("Could not write request ref = %d notify = %d", refnum, notify);
jack_error("Could not write notification ref = %d notify = %d", refnum, notify);
}
}

void JackWinNamedPipeServerNotifyChannel::NotifyQuit()
{
JackClientNotificationRequest req(-1, kQUIT, 0);
if (req.Write(&fRequestPipe) < 0) {
jack_error("Could not write request ref = %d notify = %d", -1, kQUIT);
}
Notify(-1, kQUIT, 0);
}

} // end of namespace


Loading…
Cancel
Save