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. |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 int ret; | 615 int ret; |
616 size_t size, written = 0; | 616 size_t size, written = 0; |
617 | 617 |
618 do { | 618 do { |
619 NS_ASSERT (!m_txBuffer.empty ()); | 619 NS_ASSERT (!m_txBuffer.empty ()); |
620 Ptr<Packet> &p = m_txBuffer.front (); | 620 Ptr<Packet> &p = m_txBuffer.front (); |
621 size = p->GetSize (); | 621 size = p->GetSize (); |
622 NS_ASSERT (size > 0); | 622 NS_ASSERT (size > 0); |
623 | 623 |
624 m_errno = ERROR_NOTERROR; | 624 m_errno = ERROR_NOTERROR; |
625 ret = m_nscTcpSocket->send_data((const char *)p->PeekData (), size); | 625 |
| 626 uint8_t *buf = new uint8_t[size]; |
| 627 p->CopyData (buf, size); |
| 628 ret = m_nscTcpSocket->send_data((const char *)buf, size); |
| 629 delete[] buf; |
| 630 |
626 if (ret <= 0) | 631 if (ret <= 0) |
627 { | 632 { |
628 break; | 633 break; |
629 } | 634 } |
630 written += ret; | 635 written += ret; |
631 | 636 |
632 NS_ASSERT (m_txBufferSize >= (size_t)ret); | 637 NS_ASSERT (m_txBufferSize >= (size_t)ret); |
633 m_txBufferSize -= ret; | 638 m_txBufferSize -= ret; |
634 | 639 |
635 if ((size_t)ret < size) | 640 if ((size_t)ret < size) |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 return true; | 846 return true; |
842 } | 847 } |
843 | 848 |
844 bool | 849 bool |
845 NscTcpSocketImpl::GetAllowBroadcast () const | 850 NscTcpSocketImpl::GetAllowBroadcast () const |
846 { | 851 { |
847 return false; | 852 return false; |
848 } | 853 } |
849 | 854 |
850 }//namespace ns3 | 855 }//namespace ns3 |
LEFT | RIGHT |