summaryrefslogtreecommitdiffstats
path: root/tests/Network/EchoServer.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-01-12 10:17:11 +0100
committerMattes D <github@xoft.cz>2015-01-22 20:12:47 +0100
commita2aa37bdc505c72edd5c9d41bac6e7679cea13c3 (patch)
treec6dff3370af92807b84808c438edd7eb406812f2 /tests/Network/EchoServer.cpp
parentcNetwork: Implemented basic server functionality. (diff)
downloadcuberite-a2aa37bdc505c72edd5c9d41bac6e7679cea13c3.tar
cuberite-a2aa37bdc505c72edd5c9d41bac6e7679cea13c3.tar.gz
cuberite-a2aa37bdc505c72edd5c9d41bac6e7679cea13c3.tar.bz2
cuberite-a2aa37bdc505c72edd5c9d41bac6e7679cea13c3.tar.lz
cuberite-a2aa37bdc505c72edd5c9d41bac6e7679cea13c3.tar.xz
cuberite-a2aa37bdc505c72edd5c9d41bac6e7679cea13c3.tar.zst
cuberite-a2aa37bdc505c72edd5c9d41bac6e7679cea13c3.zip
Diffstat (limited to '')
-rw-r--r--tests/Network/EchoServer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/Network/EchoServer.cpp b/tests/Network/EchoServer.cpp
index e6571a57f..2316d1177 100644
--- a/tests/Network/EchoServer.cpp
+++ b/tests/Network/EchoServer.cpp
@@ -17,7 +17,7 @@ class cEchoServerCallbacks:
{
virtual void OnAccepted(cTCPLink & a_Link) override
{
- LOGD("New client accepted, sending welcome message.");
+ LOGD("New client accepted (%s:%p), sending welcome message.", a_Link.GetRemoteIP().c_str(), a_Link.GetRemotePort());
// Send a welcome message to each connecting client:
a_Link.Send("Welcome to the simple echo server.\r\n");
LOGD("Welcome message queued.");
@@ -35,19 +35,19 @@ class cEchoLinkCallbacks:
virtual void OnReceivedData(cTCPLink & a_Link, const char * a_Data, size_t a_Size) override
{
// Echo the incoming data back to outgoing data:
- LOGD("%p: Data received (%u bytes), echoing back.", &a_Link, static_cast<unsigned>(a_Size));
+ LOGD("%p (%s:%d): Data received (%u bytes), echoing back.", &a_Link, a_Link.GetRemoteIP().c_str(), a_Link.GetRemotePort(), static_cast<unsigned>(a_Size));
a_Link.Send(a_Data, a_Size);
LOGD("Echo queued");
}
virtual void OnRemoteClosed(cTCPLink & a_Link) override
{
- LOGD("%p: Remote has closed the connection.", &a_Link);
+ LOGD("%p (%s:%d): Remote has closed the connection.", &a_Link, a_Link.GetRemoteIP().c_str(), a_Link.GetRemotePort());
}
virtual void OnError(cTCPLink & a_Link, int a_ErrorCode) override
{
- LOGD("%p: Error %d in the cEchoLinkCallbacks.", &a_Link, a_ErrorCode);
+ LOGD("%p (%s:%d): Error %d in the cEchoLinkCallbacks.", &a_Link, a_Link.GetRemoteIP().c_str(), a_Link.GetRemotePort(), a_ErrorCode);
}
};