Update of /cvsroot/plib/plib/src/net
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17840
Modified Files:
netSocket.cxx netSocket.h
Log Message:
NetSocket patch from Oliver Schroeder (see PLIB-devel e-mail of 10/21/05)
Index: netSocket.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/net/netSocket.cxx,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- netSocket.cxx 6 Apr 2004 12:42:40 -0000 1.30
+++ netSocket.cxx 10 Nov 2005 20:55:54 -0000 1.31
@@ -117,12 +117,20 @@
return buf;
}
+unsigned int netAddress::getIP () const
+{
+ return sin_addr;
+}
-int netAddress::getPort() const
+unsigned int netAddress::getPort() const
{
[...96 lines suppressed...]
{
- int fd = writes[i]->getHandle();
- if (FD_ISSET (fd, &w)) {
- writes[k++] = writes[i];
- num++;
+ for ( k=i=0; writes[i]; i++ )
+ {
+ int fd = writes[i]->getHandle();
+ if ( FD_ISSET (fd, &w) )
+ {
+ writes[k++] = writes[i];
+ num++;
+ }
}
+ writes[k] = NULL ;
}
- writes[k] = NULL ;
return num ;
}
Index: netSocket.h
===================================================================
RCS file: /cvsroot/plib/plib/src/net/netSocket.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- netSocket.h 28 Mar 2004 03:58:24 -0000 1.20
+++ netSocket.h 10 Nov 2005 20:55:54 -0000 1.21
@@ -40,7 +40,6 @@
#ifndef NET_SOCKET_H
#define NET_SOCKET_H
-
#include "ul.h"
#include <errno.h>
@@ -61,8 +60,9 @@
void set ( const char* host, int port ) ;
const char* getHost () const ;
- int getPort() const ;
-
+ unsigned int getPort() const ;
+ unsigned int getIP () const ;
+ unsigned int getFamily () const ;
static const char* getLocalHost () ;
bool getBroadcast () const ;
@@ -85,7 +85,7 @@
void setHandle (int handle) ;
bool open ( bool stream=true ) ;
- void close ( void ) ;
+ void close ( void ) ;
int bind ( const char* host, int port ) ;
int listen ( int backlog ) ;
int accept ( netAddress* addr ) ;
|