Only a lot of debug printouts, but this version is working for SwitchKing at least

This commit is contained in:
Stefan Persson 2012-09-03 16:59:09 +02:00
parent 4af5c5b658
commit 0d8bf77a45
6 changed files with 58 additions and 5 deletions

View file

@ -1,5 +1,5 @@
#include "Socket.h"
#include "common.h"
#include <windows.h>
#include <AccCtrl.h>
#include <Aclapi.h>
@ -120,6 +120,9 @@ std::wstring Socket::read(int timeout){
if (!fSuccess) {
DWORD err = GetLastError();
if(err != ERROR_OPERATION_ABORTED){ //gets this "error" always when nothing was reads
debuglog((int)err, "Socket read error");
}
if(err == ERROR_MORE_DATA){
moreData = true;
@ -127,7 +130,8 @@ std::wstring Socket::read(int timeout){
else{
buf[0] = 0;
}
if (err == ERROR_BROKEN_PIPE) {
if (err == ERROR_BROKEN_PIPE){
debuglog(222, "Got an error, close this socket");
d->connected = false;
}
}