Bug 682

Summary: UdpEchoClient does not reset socket on StopApplication
Product: ns-3 Reporter: Josh Pelkey <jpelkey>
Component: applicationsAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: tomh
Priority: P1    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: Example script
Patch for bug 682

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