Update of /cvsroot/pclasses/pclasses2/src/Net
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25401/src/Net
Modified Files:
HTTPClient.cpp InetSocket.cpp RTSPSocket.cpp
Log Message:
Added export-macros.
Added StreamSocketServer ctor.
Index: RTSPSocket.cpp
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/src/Net/RTSPSocket.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- RTSPSocket.cpp 16 Jan 2005 00:05:00 -0000 1.2
+++ RTSPSocket.cpp 26 Jan 2005 10:25:40 -0000 1.3
@@ -26,8 +26,6 @@
namespace Net {
-extern Socket::Domain AddrFamily2Domain(int family);
-
RTSPRequest::RTSPRequest()
: _method(UNKNOWN), _url(), _urlValid(false), _protoVer("RTSP/1.0")
{
@@ -214,10 +212,15 @@
open(d);
}
+RTSPSocket::RTSPSocket(StreamSocketServer& srv)
+: StreamSocket(srv)
+{
+}
+
RTSPSocket::RTSPSocket(const NetworkAddress& addr, port_t port)
: StreamSocket()
{
- open(AddrFamily2Domain(addr.family()));
+ open(addrFamily2Domain(addr.family()));
connect(addr, port);
}
Index: HTTPClient.cpp
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/src/Net/HTTPClient.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- HTTPClient.cpp 14 Jan 2005 14:58:05 -0000 1.2
+++ HTTPClient.cpp 26 Jan 2005 10:25:40 -0000 1.3
@@ -221,32 +221,6 @@
return ret;
}
-Socket::Domain AddrFamily2Domain(int family)
-{
- Socket::Domain d;
- switch(family)
- {
- case AF_INET:
- d = Socket::Inet;
- break;
- case AF_INET6:
- d = Socket::Inet6;
- break;
- case AF_IPX:
- d = Socket::IPX;
- break;
- case AF_APPLETALK:
- d = Socket::AppleTalk;
- break;
- default:
- throw;
- }
-
- return d;
-}
-
-
-
HTTPClient::HTTPClient()
: StreamSocket()
{
@@ -261,7 +235,7 @@
HTTPClient::HTTPClient(const NetworkAddress& addr, port_t port)
: StreamSocket()
{
- open(AddrFamily2Domain(addr.family()));
+ open(addrFamily2Domain(addr.family()));
connect(addr, port);
}
Index: InetSocket.cpp
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/src/Net/InetSocket.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- InetSocket.cpp 23 Dec 2004 04:32:18 -0000 1.2
+++ InetSocket.cpp 26 Jan 2005 10:25:40 -0000 1.3
@@ -44,7 +44,7 @@
{
}
-void InetSocket::open(Type type, int proto) throw(LogicError, IO::IOError)
+void InetSocket::open(Type type, int proto) throw(IO::IOError)
{
Socket::open(Socket::Inet, type, proto);
}
@@ -84,7 +84,7 @@
{
}
-void UDPSocket::open() throw(LogicError, IO::IOError)
+void UDPSocket::open() throw(IO::IOError)
{
InetSocket::open(Socket::Datagram, IPPROTO_UDP);
}
@@ -164,11 +164,22 @@
InetSocket::open(Socket::Stream, IPPROTO_TCP);
}
+TCPSocket::TCPSocket(StreamSocketServer& srv) throw(IO::IOError)
+: InetSocket(), StreamSocket()
+{
+ open(srv);
+}
+
TCPSocket::~TCPSocket() throw()
{
}
-void TCPSocket::open() throw(LogicError, IO::IOError)
+void TCPSocket::open(StreamSocketServer& srv) throw(IO::IOError)
+{
+ StreamSocket::open(srv);
+}
+
+void TCPSocket::open() throw(IO::IOError)
{
InetSocket::open(Socket::Stream, IPPROTO_TCP);
}
|