Logging changes

This commit is contained in:
Jack Andersen 2018-02-04 20:55:20 -10:00
parent c06141af1e
commit 349263a88c
1 changed files with 4 additions and 4 deletions

View File

@ -98,7 +98,7 @@ bool Socket::openSocket()
m_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (m_socket == -1)
{
fprintf(stderr, "Can't allocate socket");
fprintf(stderr, "Can't allocate socket\n");
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)
{
/* 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;
}
if (::listen(m_socket, 0) == -1)
{
/* 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;
}
@ -187,7 +187,7 @@ Socket::EResult Socket::accept(Socket& remoteSocketOut, sockaddr_in& fromAddress
#ifndef _WIN32
EResult res = (errno == EAGAIN) ? EResult::Busy : 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
EResult res = LastWSAError();
if (res == EResult::Error)