summaryrefslogtreecommitdiff
path: root/src/socket.cc
diff options
context:
space:
mode:
authordeva <deva>2005-05-03 17:13:25 +0000
committerdeva <deva>2005-05-03 17:13:25 +0000
commit099291cc4cc648c1938a7245d9abccbc6738a46d (patch)
treeccd38cd78cd87a9d34c06ce48b35501738786f06 /src/socket.cc
parentf7523239e45fb930db0273170cb93cb09fe370b5 (diff)
Fixed some missong Info object references.
Diffstat (limited to 'src/socket.cc')
-rw-r--r--src/socket.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/socket.cc b/src/socket.cc
index 4b282b4..c01e31d 100644
--- a/src/socket.cc
+++ b/src/socket.cc
@@ -31,6 +31,9 @@
/*
* $Log$
+ * Revision 1.5 2005/05/03 17:13:25 deva
+ * Fixed some missong Info object references.
+ *
* Revision 1.4 2005/05/03 08:31:59 deva
* Removed the error object, and replaced it with a more generic info object.
*
@@ -42,6 +45,8 @@
#include "socket.h"
+#include <errno.h>
+
Socket::Socket(Info *ginfo)
{
info = ginfo;
@@ -83,10 +88,10 @@ Socket::~Socket()
Socket Socket::slisten()
{
- Socket s = Socket();
+ Socket s = Socket(info);
if(err) {
- info->error("Socket: No socket present!");
+ //info->error("Socket: No socket present!");
return s;
}
if(!connected) {
@@ -94,7 +99,7 @@ Socket Socket::slisten()
err = bind(ssocket, (struct sockaddr*)&socketaddr, sizeof(socketaddr));
if (err) {
- info->error("Socket: bind() failed!");
+ info->error("Socket: bind() failed! %s", strerror(errno));
return s;
}
@@ -102,7 +107,7 @@ Socket Socket::slisten()
// requests (max 5 in queue)
err = listen(ssocket, 5);
if(err) {
- info->error("Socket: listen() failed!");
+ info->error("Socket: listen() failed! %s", strerror(errno));
return s;
}
}
@@ -116,7 +121,7 @@ Socket Socket::slisten()
if (s.ssocket < 0) {
err = 1;
- info->error("Socket: accept() failed!");
+ info->error("Socket: accept() failed! %s", strerror(errno));
return s;
}
@@ -139,7 +144,7 @@ int Socket::sconnect(char *ip)
err = connect(ssocket, (struct sockaddr*)&socketaddr, sizeof(socketaddr));
if (err) {
- info->error("Socket: connect() failed!");
+ info->error("Socket: connect() failed! %s", strerror(errno));
return err;
}
// fprintf(stderr, "Socket connected\n");