Skip to content

Commit

Permalink
Exceptions caught bei const reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
offa committed Nov 5, 2014
1 parent 9adb20d commit 83a7d5c
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples++/client.cpp
Expand Up @@ -35,7 +35,7 @@ int main(void)
sock << "Hello back!\n";

sock.destroy();
} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg;
}
Expand Down
4 changes: 2 additions & 2 deletions examples++/echo_client_conn.cpp
Expand Up @@ -22,7 +22,7 @@ int main(void)

try {
std::cout << sock.gethost();
} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg;
}
Expand All @@ -40,7 +40,7 @@ int main(void)

sock.deconnect();
}
} catch ( libsocket::socket_exception exc )
} catch ( const libsocket::socket_exception& exc )
{
std::cerr << exc.mesg;
}
Expand Down
2 changes: 1 addition & 1 deletion examples++/echo_client_sndto.cpp
Expand Up @@ -39,7 +39,7 @@ int main(void)

std::cout.flush();
}
} catch ( libsocket::socket_exception exc )
} catch ( const libsocket::socket_exception& exc )
{
std::cerr << exc.mesg;
}
Expand Down
2 changes: 1 addition & 1 deletion examples++/echo_server.cpp
Expand Up @@ -32,7 +32,7 @@ int main(void)
}

srv.destroy();
} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg;
}
Expand Down
2 changes: 1 addition & 1 deletion examples++/http.cpp
Expand Up @@ -35,7 +35,7 @@ int main(void)
}

//sock.destroy(); // socket is also destroyed by the constructor
} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg;
}
Expand Down
2 changes: 1 addition & 1 deletion examples++/http_2.cpp
Expand Up @@ -25,7 +25,7 @@ int main(void)

while ( 0 != (len=sock.rcv(buf,10000)) )
std::cout << string(buf,len); // write only as many characters as we read
} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg;
}
Expand Down
2 changes: 1 addition & 1 deletion examples++/http_epoll.cpp
Expand Up @@ -47,7 +47,7 @@ int main(void)
}

//sock.destroy(); // socket is also destroyed by the constructor
} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg;
}
Expand Down
2 changes: 1 addition & 1 deletion examples++/server.cpp
Expand Up @@ -67,7 +67,7 @@ int main(void)

srv.destroy();

} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg << std::endl;
}
Expand Down
2 changes: 1 addition & 1 deletion examples++/unix_client_stream.cpp
Expand Up @@ -23,7 +23,7 @@ int main(void)
sock.rcv(answer,127);

std::cout << answer;
} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg;
}
Expand Down
2 changes: 1 addition & 1 deletion examples++/unix_dgram_client.cpp
Expand Up @@ -25,7 +25,7 @@ int main(void)

cl.destroy();

} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg;
}
Expand Down
2 changes: 1 addition & 1 deletion examples++/unix_dgram_server.cpp
Expand Up @@ -24,7 +24,7 @@ int main(void)

srv.destroy();

} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg;
}
Expand Down
2 changes: 1 addition & 1 deletion examples++/unix_dgram_syslogclient.cpp
Expand Up @@ -16,7 +16,7 @@ int main(void)
logcl.sndto(logmsg,sock);

logcl.destroy();
} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg;
}
Expand Down
2 changes: 1 addition & 1 deletion examples++/unix_server_stream.cpp
Expand Up @@ -38,7 +38,7 @@ int main(void)

srv.destroy();

} catch (libsocket::socket_exception exc)
} catch (const libsocket::socket_exception& exc)
{
std::cerr << exc.mesg;
}
Expand Down

0 comments on commit 83a7d5c

Please sign in to comment.