Commit 1bbfc814 authored by sletz's avatar sletz
Browse files

More debug messages

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1838 0c269be4-1314-0410-8aa9-9f06e86f4224
parent f3b05930
......@@ -2,6 +2,8 @@
Jackdmp Todo list
---------------------
2008-02-06 : Do a "fork-exec" for the server (deamon..)
2008-02-05 : Hierarchical model: having several client graph running simultaneously (Fons) with a "link" between them (AKA NetJack)
2008-01-15 : Server control API (Nedko Arnoudov): would help to develop external control applications (DBUS or OSC based...)
......
......@@ -33,7 +33,7 @@ void JackClientSocket::SetReadTimeOut(long sec)
timout.tv_sec = sec;
timout.tv_usec = 0;
if (setsockopt(fSocket, SOL_SOCKET, SO_RCVTIMEO, (const char*)&timout, sizeof(timeval)) < 0) {
JackLog("setsockopt SO_RCVTIMEO fd = %ld err = (%s)\n", fSocket, strerror(errno));
JackLog("setsockopt SO_RCVTIMEO fd = %ld err = %s\n", fSocket, strerror(errno));
}
}
......@@ -43,7 +43,7 @@ void JackClientSocket::SetWriteTimeOut(long sec)
timout.tv_sec = sec ;
timout.tv_usec = 0;
if (setsockopt(fSocket, SOL_SOCKET, SO_SNDTIMEO, (const char*)&timout, sizeof(timeval)) < 0) {
JackLog("setsockopt SO_SNDTIMEO fd = %ld err = (%s)\n", fSocket, strerror(errno));
JackLog("setsockopt SO_SNDTIMEO fd = %ld err = %s\n", fSocket, strerror(errno));
}
}
......@@ -52,7 +52,7 @@ int JackClientSocket::Connect(const char* dir, const char* name, int which) // A
struct sockaddr_un addr;
if ((fSocket = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
jack_error("Cannot create socket (%s)", strerror(errno));
jack_error("Cannot create socket err = %s", strerror(errno));
return -1;
}
......@@ -61,7 +61,7 @@ int JackClientSocket::Connect(const char* dir, const char* name, int which) // A
JackLog("Connect: addr.sun_path %s\n", addr.sun_path);
if (connect(fSocket, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
jack_error("Cannot connect to server socket (%s)", strerror(errno));
jack_error("Cannot connect to server socket err = %s", strerror(errno));
close(fSocket);
return -1;
}
......@@ -81,7 +81,7 @@ int JackClientSocket::Connect(const char* dir, int which)
struct sockaddr_un addr;
if ((fSocket = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
jack_error("Cannot create socket (%s)", strerror(errno));
jack_error("Cannot create socket err = %s", strerror(errno));
return -1;
}
......@@ -90,7 +90,7 @@ int JackClientSocket::Connect(const char* dir, int which)
JackLog("Connect: addr.sun_path %s\n", addr.sun_path);
if (connect(fSocket, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
jack_error("Cannot connect to server socket (%s)", strerror(errno));
jack_error("Cannot connect to server socket err = %s", strerror(errno));
close(fSocket);
return -1;
}
......@@ -123,7 +123,7 @@ int JackClientSocket::Read(void* data, int len)
int len1;
if ((len1 = read(fSocket, data, len)) != len) {
jack_error("Cannot read socket %d %d (%s)", len, len1, strerror(errno));
jack_error("Cannot read socket fd = %d err = %s", fSocket, strerror(errno));
if (errno == EWOULDBLOCK) {
JackLog("JackClientSocket::Read time out\n");
return 0;
......@@ -138,7 +138,7 @@ int JackClientSocket::Read(void* data, int len)
int JackClientSocket::Write(void* data, int len)
{
if (write(fSocket, data, len) != len) {
jack_error("Cannot write socket fd %ld (%s)", fSocket, strerror(errno));
jack_error("Cannot write socket fd = %ld err = %s", fSocket, strerror(errno));
return -1;
} else {
return 0;
......@@ -150,7 +150,7 @@ int JackServerSocket::Bind(const char* dir, const char* name, int which) // A re
struct sockaddr_un addr;
if ((fSocket = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
jack_error("Cannot create server socket (%s)", strerror(errno));
jack_error("Cannot create server socket err = %s", strerror(errno));
return -1;
}
......@@ -169,12 +169,12 @@ int JackServerSocket::Bind(const char* dir, const char* name, int which) // A re
unlink(fName); // Security...
if (bind(fSocket, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
jack_error("Cannot bind server to socket (%s)", strerror(errno));
jack_error("Cannot bind server to socket err = %s", strerror(errno));
goto error;
}
if (listen(fSocket, 1) < 0) {
jack_error("Cannot enable listen on server socket (%s)", strerror(errno));
jack_error("Cannot enable listen on server socket err = %s", strerror(errno));
goto error;
}
......@@ -191,7 +191,7 @@ int JackServerSocket::Bind(const char* dir, int which) // A revoir : utilisation
struct sockaddr_un addr;
if ((fSocket = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
jack_error("Cannot create server socket (%s)", strerror(errno));
jack_error("Cannot create server socket err = %s", strerror(errno));
return -1;
}
......@@ -220,12 +220,12 @@ int JackServerSocket::Bind(const char* dir, int which) // A revoir : utilisation
unlink(fName); // Security...
if (bind(fSocket, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
jack_error("Cannot bind server to socket (%s)", strerror(errno));
jack_error("Cannot bind server to socket err = %s", strerror(errno));
goto error;
}
if (listen(fSocket, 1) < 0) {
jack_error("Cannot enable listen on server socket (%s)", strerror(errno));
jack_error("Cannot enable listen on server socket err = %s", strerror(errno));
goto error;
}
......@@ -247,7 +247,7 @@ JackClientSocket* JackServerSocket::Accept()
int fd = accept(fSocket, (struct sockaddr*) & client_addr, &client_addrlen);
if (fd < 0) {
jack_error("Cannot accept new connection (%s)", strerror(errno));
jack_error("Cannot accept new connection err = %s", strerror(errno));
return 0;
} else {
return new JackClientSocket(fd);
......
......@@ -157,7 +157,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackClientCheckResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->ClientCheck(req.fName, res.fName, req.fProtocol, req.fOptions, &res.fStatus);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kClientCheck write error name = %s", req.fName);
break;
}
......@@ -167,7 +168,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackClientOpenResult res;
if (req.Read(socket) == 0)
ClientAdd(fd, req.fName, &res.fSharedEngine, &res.fSharedClient, &res.fSharedGraph, &res.fResult);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kClientOpen write error name = %s", req.fName);
break;
}
......@@ -177,7 +179,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->ClientExternalClose(req.fRefNum);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kClientClose write error ref = %d", req.fRefNum);
ClientRemove(fd, req.fRefNum);
break;
}
......@@ -188,7 +191,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackLog("JackRequest::ActivateClient\n");
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->ClientActivate(req.fRefNum);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kActivateClient write error ref = %d", req.fRefNum);
break;
}
......@@ -198,7 +202,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->ClientDeactivate(req.fRefNum);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kDeactivateClient write error ref = %d", req.fRefNum);
break;
}
......@@ -208,7 +213,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackPortRegisterResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->PortRegister(req.fRefNum, req.fName, req.fPortType, req.fFlags, req.fBufferSize, &res.fPortIndex);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kRegisterPort write error ref = %d", req.fRefNum);
break;
}
......@@ -218,7 +224,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->PortUnRegister(req.fRefNum, req.fPortIndex);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kUnRegisterPort write error ref = %d", req.fRefNum);
break;
}
......@@ -228,7 +235,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->PortConnect(req.fRefNum, req.fSrc, req.fDst);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kConnectNamePorts write error ref = %d", req.fRefNum);
break;
}
......@@ -238,7 +246,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->PortDisconnect(req.fRefNum, req.fSrc, req.fDst);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kDisconnectNamePorts write error ref = %d", req.fRefNum);
break;
}
......@@ -248,7 +257,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->PortConnect(req.fRefNum, req.fSrc, req.fDst);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kConnectPorts write error ref = %d", req.fRefNum);
break;
}
......@@ -258,7 +268,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->PortDisconnect(req.fRefNum, req.fSrc, req.fDst);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kDisconnectPorts write error ref = %d", req.fRefNum);
break;
}
......@@ -268,7 +279,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->SetBufferSize(req.fBufferSize);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kSetBufferSize write error");
break;
}
......@@ -278,7 +290,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->SetFreewheel(req.fOnOff);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kSetFreeWheel write error");
break;
}
......@@ -288,7 +301,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->ReleaseTimebase(req.fRefNum);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kReleaseTimebase write error ref = %d", req.fRefNum);
break;
}
......@@ -298,7 +312,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->SetTimebaseCallback(req.fRefNum, req.fConditionnal);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kSetTimebaseCallback write error ref = %d", req.fRefNum);
break;
}
......@@ -308,7 +323,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackGetInternalClientNameResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->GetInternalClientName(req.fIntRefNum, res.fName);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kGetInternalClientName write error ref = %d", req.fRefNum);
break;
}
......@@ -318,7 +334,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackInternalClientHandleResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->InternalClientHandle(req.fName, &res.fStatus, &res.fIntRefNum);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kInternalClientHandle write error ref = %d", req.fRefNum);
break;
}
......@@ -328,7 +345,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackInternalClientLoadResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->InternalClientLoad(req.fName, req.fDllName, req.fLoadInitName, req.fOptions, &res.fIntRefNum, &res.fStatus);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kInternalClientLoad write error name = %s", req.fName);
break;
}
......@@ -338,7 +356,8 @@ int JackSocketServerChannel::HandleRequest(int fd)
JackInternalClientUnloadResult res;
if (req.Read(socket) == 0)
res.fResult = fServer->GetEngine()->InternalClientUnload(req.fIntRefNum, &res.fStatus);
res.Write(socket);
if (res.Write(socket) < 0)
jack_error("JackRequest::kInternalClientUnload write error ref = %d", req.fRefNum);
break;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment