LEFT | RIGHT |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * This program is free software; you can redistribute it and/or modify | 3 * This program is free software; you can redistribute it and/or modify |
4 * it under the terms of the GNU General Public License version 2 as | 4 * it under the terms of the GNU General Public License version 2 as |
5 * published by the Free Software Foundation; | 5 * published by the Free Software Foundation; |
6 * | 6 * |
7 * This program is distributed in the hope that it will be useful, | 7 * This program is distributed in the hope that it will be useful, |
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 * GNU General Public License for more details. | 10 * GNU General Public License for more details. |
11 * | 11 * |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 m_txBufferSize (0), | 78 m_txBufferSize (0), |
79 m_lastMeasuredRtt (Seconds (0.0)) | 79 m_lastMeasuredRtt (Seconds (0.0)) |
80 { | 80 { |
81 NS_LOG_FUNCTION (this); | 81 NS_LOG_FUNCTION (this); |
82 } | 82 } |
83 | 83 |
84 NscTcpSocketImpl::NscTcpSocketImpl(const NscTcpSocketImpl& sock) | 84 NscTcpSocketImpl::NscTcpSocketImpl(const NscTcpSocketImpl& sock) |
85 : TcpSocket (sock), //copy the base class callbacks | 85 : TcpSocket (sock), //copy the base class callbacks |
86 m_delAckMaxCount (sock.m_delAckMaxCount), | 86 m_delAckMaxCount (sock.m_delAckMaxCount), |
87 m_delAckTimeout (sock.m_delAckTimeout), | 87 m_delAckTimeout (sock.m_delAckTimeout), |
| 88 m_noDelay (sock.m_noDelay), |
88 m_endPoint (0), | 89 m_endPoint (0), |
89 m_node (sock.m_node), | 90 m_node (sock.m_node), |
90 m_tcp (sock.m_tcp), | 91 m_tcp (sock.m_tcp), |
91 m_remoteAddress (sock.m_remoteAddress), | 92 m_remoteAddress (sock.m_remoteAddress), |
92 m_remotePort (sock.m_remotePort), | 93 m_remotePort (sock.m_remotePort), |
93 m_localAddress (sock.m_localAddress), | 94 m_localAddress (sock.m_localAddress), |
94 m_localPort (sock.m_localPort), | 95 m_localPort (sock.m_localPort), |
95 m_peerAddress (sock.m_peerAddress), | 96 m_peerAddress (sock.m_peerAddress), |
96 m_errno (sock.m_errno), | 97 m_errno (sock.m_errno), |
97 m_shutdownSend (sock.m_shutdownSend), | 98 m_shutdownSend (sock.m_shutdownSend), |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 NS_LOG_FUNCTION (this); | 130 NS_LOG_FUNCTION (this); |
130 m_node = 0; | 131 m_node = 0; |
131 if (m_endPoint != 0) | 132 if (m_endPoint != 0) |
132 { | 133 { |
133 NS_ASSERT (m_tcp != 0); | 134 NS_ASSERT (m_tcp != 0); |
134 /** | 135 /** |
135 * Note that this piece of code is a bit tricky: | 136 * Note that this piece of code is a bit tricky: |
136 * when DeAllocate is called, it will call into | 137 * when DeAllocate is called, it will call into |
137 * Ipv4EndPointDemux::Deallocate which triggers | 138 * Ipv4EndPointDemux::Deallocate which triggers |
138 * a delete of the associated endPoint which triggers | 139 * a delete of the associated endPoint which triggers |
139 * in turn a call to the method ::Destroy below | 140 * in turn a call to the method NscTcpSocketImpl::Destroy below |
140 * will will zero the m_endPoint field. | 141 * will will zero the m_endPoint field. |
141 */ | 142 */ |
142 NS_ASSERT (m_endPoint != 0); | 143 NS_ASSERT (m_endPoint != 0); |
143 m_tcp->DeAllocate (m_endPoint); | 144 m_tcp->DeAllocate (m_endPoint); |
144 NS_ASSERT (m_endPoint == 0); | 145 NS_ASSERT (m_endPoint == 0); |
145 } | 146 } |
146 m_tcp = 0; | 147 m_tcp = 0; |
147 } | 148 } |
148 | 149 |
149 void | 150 void |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 int | 210 int |
210 NscTcpSocketImpl::Bind (void) | 211 NscTcpSocketImpl::Bind (void) |
211 { | 212 { |
212 NS_LOG_FUNCTION_NOARGS (); | 213 NS_LOG_FUNCTION_NOARGS (); |
213 m_endPoint = m_tcp->Allocate (); | 214 m_endPoint = m_tcp->Allocate (); |
214 return FinishBind (); | 215 return FinishBind (); |
215 } | 216 } |
216 int | 217 int |
217 NscTcpSocketImpl::Bind6 () | 218 NscTcpSocketImpl::Bind6 () |
218 { | 219 { |
| 220 m_errno = EAFNOSUPPORT; |
| 221 NS_LOG_ERROR("NSC Tcp socket does not support binding to IPv6 \"any\" address"
); |
219 return (-1); | 222 return (-1); |
220 } | 223 } |
221 int· | 224 int· |
222 NscTcpSocketImpl::Bind (const Address &address) | 225 NscTcpSocketImpl::Bind (const Address &address) |
223 { | 226 { |
224 NS_LOG_FUNCTION (this<<address); | 227 NS_LOG_FUNCTION (this<<address); |
225 if (!InetSocketAddress::IsMatchingType (address)) | 228 if (!InetSocketAddress::IsMatchingType (address)) |
226 { | 229 { |
227 return ERROR_INVAL; | 230 return ERROR_INVAL; |
228 } | 231 } |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 { | 798 { |
796 m_delAckMaxCount = count; | 799 m_delAckMaxCount = count; |
797 } | 800 } |
798 | 801 |
799 uint32_t | 802 uint32_t |
800 NscTcpSocketImpl::GetDelAckMaxCount (void) const | 803 NscTcpSocketImpl::GetDelAckMaxCount (void) const |
801 { | 804 { |
802 return m_delAckMaxCount; | 805 return m_delAckMaxCount; |
803 } | 806 } |
804 | 807 |
| 808 void |
| 809 NscTcpSocketImpl::SetTcpNoDelay (bool noDelay) |
| 810 { |
| 811 m_noDelay = noDelay; |
| 812 } |
| 813 |
| 814 bool |
| 815 NscTcpSocketImpl::GetTcpNoDelay (void) const |
| 816 { |
| 817 return m_noDelay; |
| 818 } |
| 819 |
805 void· | 820 void· |
806 NscTcpSocketImpl::SetPersistTimeout (Time timeout) | 821 NscTcpSocketImpl::SetPersistTimeout (Time timeout) |
807 { | 822 { |
808 m_persistTimeout = timeout; | 823 m_persistTimeout = timeout; |
809 } | 824 } |
810 | 825 |
811 Time | 826 Time |
812 NscTcpSocketImpl::GetPersistTimeout (void) const | 827 NscTcpSocketImpl::GetPersistTimeout (void) const |
813 { | 828 { |
814 return m_persistTimeout; | 829 return m_persistTimeout; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 } | 873 } |
859 return true; | 874 return true; |
860 } | 875 } |
861 | 876 |
862 bool | 877 bool |
863 NscTcpSocketImpl::GetAllowBroadcast () const | 878 NscTcpSocketImpl::GetAllowBroadcast () const |
864 { | 879 { |
865 return false; | 880 return false; |
866 } | 881 } |
867 | 882 |
868 } //namespace ns3 | 883 } // namespace ns3 |
LEFT | RIGHT |