StefanKopieczek / gossip

SIP stack in Golang
GNU Lesser General Public License v2.1
336 stars 109 forks source link

Why Send via UDP should open and close connection? #40

Closed rucciva closed 6 years ago

rucciva commented 6 years ago

Hi, I would like to ask what is the reason behind opening a new connection and closing it immediately when sending the data using Send() function on UDP transport?

Why don't the function use the one from listeningPoints as there should be a minimum of one connection in here due to the call of Listen() in transport.manager.NewManager() ?

And shouldn't we also need to wait for response of the Send() function (e.g. in ClientTransaction case) in the same source port? Closing the connection will close the source port and the response will not be received.