summaryrefslogtreecommitdiff
path: root/Ivy/BufferedSocket.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Ivy/BufferedSocket.cxx')
-rw-r--r--Ivy/BufferedSocket.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/Ivy/BufferedSocket.cxx b/Ivy/BufferedSocket.cxx
index 1a11c56..fcf90c6 100644
--- a/Ivy/BufferedSocket.cxx
+++ b/Ivy/BufferedSocket.cxx
@@ -163,6 +163,23 @@ void CBufferedSocket::Send ( const char * data )
// if ( connected )
// {
bool ok = SignalWriter();
- if ( !ok ) TRACE( "CBufferedSocket::SignalWriter Error %d\n", this->GetLastError());
+ if ( !ok )
+ {
+ char* lpMsgBuf;
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ this->GetLastError(),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+ (LPTSTR) &lpMsgBuf,
+ 0,
+ NULL );
+ lpMsgBuf[strlen(lpMsgBuf) -2] = '\0'; // remove last \n
+ TRACE( "CBufferedSocket::SignalWriter Error %s\n",lpMsgBuf );
+ // Free the buffer.
+ LocalFree( lpMsgBuf );
+ }
// }
}