Removed socket non-errors, added success message for opening listening sockets.
This commit is contained in:
parent
28548f35b0
commit
a86051b319
1 changed files with 6 additions and 12 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue