Removed socket non-errors, added success message for opening listening sockets.

This commit is contained in:
Thulinma 2012-08-14 20:53:32 +02:00
parent 28548f35b0
commit a86051b319

View file

@ -203,9 +203,6 @@ signed int Socket::Connection::ready(){
} }
} }
if (r == 0){ if (r == 0){
#if DEBUG >= 4
fprintf(stderr, "Socket ready error - socket is closed.\n");
#endif
close(); close();
return -1; return -1;
} }
@ -311,9 +308,6 @@ bool Socket::Connection::read(const void * buffer, int len){
}else{ }else{
if (r == 0){ if (r == 0){
Error = true; Error = true;
#if DEBUG >= 2
fprintf(stderr, "Could not read data! Socket is closed.\n");
#endif
close(); close();
down += sofar; down += sofar;
return false; return false;
@ -354,9 +348,6 @@ int Socket::Connection::iwrite(const void * buffer, int len){
} }
} }
if (r == 0){ if (r == 0){
#if DEBUG >= 4
fprintf(stderr, "Could not iwrite data! Socket is closed.\n");
#endif
close(); close();
} }
up += r; up += r;
@ -385,9 +376,6 @@ int Socket::Connection::iread(void * buffer, int len){
} }
} }
if (r == 0){ if (r == 0){
#if DEBUG >= 4
fprintf(stderr, "Could not iread data! Socket is closed.\n");
#endif
close(); close();
} }
down += r; down += r;
@ -522,6 +510,9 @@ bool Socket::Server::IPv6bind(int port, std::string hostname, bool nonblock){
if (ret == 0){ if (ret == 0){
ret = listen(sock, 100);//start listening, backlog of 100 allowed ret = listen(sock, 100);//start listening, backlog of 100 allowed
if (ret == 0){ if (ret == 0){
#if DEBUG >= 1
fprintf(stderr, "IPv6 socket success @ %s:%i\n", hostname.c_str(), port);
#endif
return true; return true;
}else{ }else{
#if DEBUG >= 1 #if DEBUG >= 1
@ -571,6 +562,9 @@ bool Socket::Server::IPv4bind(int port, std::string hostname, bool nonblock){
if (ret == 0){ if (ret == 0){
ret = listen(sock, 100);//start listening, backlog of 100 allowed ret = listen(sock, 100);//start listening, backlog of 100 allowed
if (ret == 0){ if (ret == 0){
#if DEBUG >= 1
fprintf(stderr, "IPv4 socket success @ %s:%i\n", hostname.c_str(), port);
#endif
return true; return true;
}else{ }else{
#if DEBUG >= 1 #if DEBUG >= 1