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.
23 // TODO: Implement possibly non-blocking connect and SO_ERROR in the
26 #ifndef HH_TCPSocketHandle_
27 #define HH_TCPSocketHandle_ 1
30 #include "INetProtocol.hh"
31 #include "TCPProtocol.hh"
32 #include "BSDSocketProtocol.hh"
33 #include "FramingPolicy.hh"
34 #include "CommunicationPolicy.hh"
35 #include "ReadWritePolicy.hh"
36 #include "BufferingPolicy.hh"
37 #include "ProtocolClientSocketHandle.hh"
38 #include "ProtocolServerSocketHandle.hh"
40 //#include "TCPSocketHandle.mpp"
41 ///////////////////////////////hh.p////////////////////////////////////////
46 typedef MakeSocketPolicy<
47 INet4AddressingPolicy,
49 ConnectedCommunicationPolicy,
53 >::policy TCPv4Socket_Policy;
55 class TCPv4SocketProtocol
56 : public ConcreteSocketProtocol<TCPv4Socket_Policy>,
59 public BSDSocketProtocol,
60 public AddressableBSDSocketProtocol
63 ///////////////////////////////////////////////////////////////////////////
66 void init_client() const;
67 void init_client(INet4Address const & address) const;
68 void init_server() const;
69 void init_server(INet4Address const & address, unsigned backlog=1) const;
71 std::auto_ptr<SocketProtocol> clone() const;
74 typedef ProtocolClientSocketHandle<TCPv4SocketProtocol> TCPv4ClientSocketHandle;
75 typedef ProtocolServerSocketHandle<TCPv4SocketProtocol> TCPv4ServerSocketHandle;
77 typedef MakeSocketPolicy<
80 >::policy TCPv6Socket_Policy;
82 class TCPv6SocketProtocol
83 : public ConcreteSocketProtocol<TCPv6Socket_Policy>,
86 public BSDSocketProtocol,
87 public AddressableBSDSocketProtocol
92 typedef ProtocolClientSocketHandle<TCPv6SocketProtocol> TCPv6ClientSocketHandle;
93 typedef ProtocolServerSocketHandle<TCPv6SocketProtocol> TCPv6ServerSocketHandle;
97 ///////////////////////////////hh.e////////////////////////////////////////
98 //#include "TCPSocketHandle.cci"
99 //#include "TCPSocketHandle.ct"
100 //#include "TCPSocketHandle.cti"
106 // c-file-style: "satcom"