4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 // Stefan Bund <stefan.bund@fokus.fraunhofer.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 \todo Implement possibly non-blocking connect and SO_ERROR in the
29 #ifndef HH_TCPSocketHandle_
30 #define HH_TCPSocketHandle_ 1
33 #include "INetProtocol.hh"
34 #include "TCPProtocol.hh"
35 #include "BSDSocketProtocol.hh"
36 #include "FramingPolicy.hh"
37 #include "CommunicationPolicy.hh"
38 #include "ReadWritePolicy.hh"
39 #include "BufferingPolicy.hh"
40 #include "ProtocolClientSocketHandle.hh"
41 #include "ProtocolServerSocketHandle.hh"
43 //#include "TCPSocketHandle.mpp"
44 ///////////////////////////////hh.p////////////////////////////////////////
49 typedef MakeSocketPolicy<
50 INet4AddressingPolicy,
52 ConnectedCommunicationPolicy,
56 >::policy TCPv4Socket_Policy;
58 class TCPv4SocketProtocol
59 : public ConcreteSocketProtocol<TCPv4Socket_Policy>,
62 public BSDSocketProtocol,
63 public AddressableBSDSocketProtocol
66 ///////////////////////////////////////////////////////////////////////////
69 void init_client() const;
70 void init_client(INet4Address const & address) const;
71 void init_server() const;
72 void init_server(INet4Address const & address, unsigned backlog=1) const;
74 std::auto_ptr<SocketProtocol> clone() const;
77 typedef ProtocolClientSocketHandle<TCPv4SocketProtocol> TCPv4ClientSocketHandle;
78 typedef ProtocolServerSocketHandle<TCPv4SocketProtocol> TCPv4ServerSocketHandle;
80 typedef MakeSocketPolicy<
83 >::policy TCPv6Socket_Policy;
85 class TCPv6SocketProtocol
86 : public ConcreteSocketProtocol<TCPv6Socket_Policy>,
89 public BSDSocketProtocol,
90 public AddressableBSDSocketProtocol
92 /** \todo Implement */
95 typedef ProtocolClientSocketHandle<TCPv6SocketProtocol> TCPv6ClientSocketHandle;
96 typedef ProtocolServerSocketHandle<TCPv6SocketProtocol> TCPv6ServerSocketHandle;
100 ///////////////////////////////hh.e////////////////////////////////////////
101 //#include "TCPSocketHandle.cci"
102 //#include "TCPSocketHandle.ct"
103 //#include "TCPSocketHandle.cti"
109 // c-file-style: "senf"