mirror of https://github.com/AxioDL/jbus.git
Logging changes
This commit is contained in:
parent
c06141af1e
commit
349263a88c
|
@ -98,7 +98,7 @@ bool Socket::openSocket()
|
||||||
m_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
m_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
if (m_socket == -1)
|
if (m_socket == -1)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Can't allocate socket");
|
fprintf(stderr, "Can't allocate socket\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,14 +158,14 @@ bool Socket::openAndListen(const IPAddress& address, uint32_t port)
|
||||||
if (bind(m_socket, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) == -1)
|
if (bind(m_socket, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) == -1)
|
||||||
{
|
{
|
||||||
/* Not likely to happen, but... */
|
/* Not likely to happen, but... */
|
||||||
fprintf(stderr, "Failed to bind listener socket to port %d", port);
|
//fprintf(stderr, "Failed to bind listener socket to port %d\n", port);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (::listen(m_socket, 0) == -1)
|
if (::listen(m_socket, 0) == -1)
|
||||||
{
|
{
|
||||||
/* Oops, socket is deaf */
|
/* Oops, socket is deaf */
|
||||||
fprintf(stderr, "Failed to listen to port %d", port);
|
//fprintf(stderr, "Failed to listen to port %d\n", port);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ Socket::EResult Socket::accept(Socket& remoteSocketOut, sockaddr_in& fromAddress
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
EResult res = (errno == EAGAIN) ? EResult::Busy : EResult::Error;
|
EResult res = (errno == EAGAIN) ? EResult::Busy : EResult::Error;
|
||||||
if (res == EResult::Error)
|
if (res == EResult::Error)
|
||||||
fprintf(stderr, "Failed to accept incoming connection: %s", strerror(errno));
|
fprintf(stderr, "Failed to accept incoming connection: %s\n", strerror(errno));
|
||||||
#else
|
#else
|
||||||
EResult res = LastWSAError();
|
EResult res = LastWSAError();
|
||||||
if (res == EResult::Error)
|
if (res == EResult::Error)
|
||||||
|
|
Loading…
Reference in New Issue