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.
24 \brief TCPv4SocketHandle and TCPv6SocketHandle non-inline non-template implementation
27 #include "TCPSocketHandle.hh"
28 //#include "TCPSocketHandle.ih"
31 #include <sys/types.h>
32 #include <sys/socket.h>
33 #include <sys/ioctl.h>
35 #include "Utils/Exception.hh"
37 //#include "TCPSocketHandle.mpp"
39 ///////////////////////////////cc.p////////////////////////////////////////
41 prefix_ void senf::TCPv4SocketProtocol::init_client()
44 int sock = ::socket(PF_INET,SOCK_STREAM,0);
46 throw SystemException(errno);
51 senf::TCPv4SocketProtocol::init_client(INet4Address const & address)
58 prefix_ void senf::TCPv4SocketProtocol::init_server()
61 int sock = ::socket(PF_INET,SOCK_STREAM,0);
63 throw SystemException(errno);
67 prefix_ void senf::TCPv4SocketProtocol::init_server(INet4Address const & address,
74 if (::listen(body().fd(),backlog) < 0)
75 throw SystemException(errno);
78 prefix_ std::auto_ptr<senf::SocketProtocol> senf::TCPv4SocketProtocol::clone()
81 return std::auto_ptr<SocketProtocol>(new TCPv4SocketProtocol());
84 ///////////////////////////////cc.e////////////////////////////////////////
86 //#include "TCPSocketHandle.mpp"
91 // c-file-style: "senf"