Bug 682 - UdpEchoClient does not reset socket on StopApplication
UdpEchoClient does not reset socket on StopApplication
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: applications
ns-3-dev
All All
: P1 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-20 20:45 UTC by Josh Pelkey
Modified: 2009-09-29 10:34 UTC (History)
1 user (show)

See Also:


Attachments
Example script (2.24 KB, text/x-c++src)
2009-09-20 20:45 UTC, Josh Pelkey
Details
Patch for bug 682 (458 bytes, patch)
2009-09-20 20:45 UTC, Josh Pelkey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Pelkey 2009-09-20 20:45:33 UTC
Created attachment 593 [details]
Example script

When StopApplication is called in UdpEchoClient, the socket is closed but not reset to zero.  Therefore, when StartApplication is called again, it will think the socket is still in place and fail to bind a new socket.  Essentially if you start, stop, and start UdpEchoClient during a simulation, it won't work.  Attached is a modified version of first.cc which shows this.  The end 3 packets are not sent (it actually says sent, but DoSendTo is never called).  I will also attach a patch with what I think is the simple solution.
Comment 1 Josh Pelkey 2009-09-20 20:45:59 UTC
Created attachment 594 [details]
Patch for bug 682
Comment 2 Tom Henderson 2009-09-29 09:45:25 UTC
(In reply to comment #1)
> Created an attachment (id=594) [details]
> Patch for bug 682
> 

+1
Comment 3 Josh Pelkey 2009-09-29 10:34:45 UTC
changeset 93b77f8fb697