00001 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * This program is free software; you can redistribute it and/or modify 00004 * it under the terms of the GNU General Public License version 2 as 00005 * published by the Free Software Foundation; 00006 * 00007 * This program is distributed in the hope that it will be useful, 00008 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 * GNU General Public License for more details. 00011 * 00012 * You should have received a copy of the GNU General Public License 00013 * along with this program; if not, write to the Free Software 00014 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00015 */ 00016 #include "nsc-tcp-socket-factory-impl.h" 00017 #include "nsc-tcp-l4-protocol.h" 00018 #include "ns3/socket.h" 00019 #include "ns3/assert.h" 00020 00021 namespace ns3 { 00022 00023 NscTcpSocketFactoryImpl::NscTcpSocketFactoryImpl () 00024 : m_tcp (0) 00025 {} 00026 NscTcpSocketFactoryImpl::~NscTcpSocketFactoryImpl () 00027 { 00028 NS_ASSERT (m_tcp == 0); 00029 } 00030 00031 void 00032 NscTcpSocketFactoryImpl::SetTcp (Ptr<NscTcpL4Protocol> tcp) 00033 { 00034 m_tcp = tcp; 00035 } 00036 00037 Ptr<Socket> 00038 NscTcpSocketFactoryImpl::CreateSocket (void) 00039 { 00040 return m_tcp->CreateSocket (); 00041 } 00042 00043 void 00044 NscTcpSocketFactoryImpl::DoDispose (void) 00045 { 00046 m_tcp = 0; 00047 TcpSocketFactory::DoDispose (); 00048 } 00049 00050 } // namespace ns3