Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/association.go b/association.go
index 2e3aab1..e0ec341 100644
--- a/association.go
+++ b/association.go
@@ -377,6 +377,8 @@ func (a *Association) closeAllTimers() {
a.ackTimer.close()
}
+var conn net.Conn
+
func (a *Association) readLoop() {
var closeErr error
defer func() {
@@ -406,6 +408,14 @@ func (a *Association) readLoop() {
break
}
+ if conn == nil {
+ conn, err = net.Dial("udp", "127.0.0.1:1234")
+ if err != nil {
+ panic(err)
+ }
+ }
+ conn.Write(buffer[:n])
+
atomic.AddUint64(&a.bytesReceived, uint64(n))
if err = a.handleInbound(buffer[:n]); err != nil {
a.log.Warnf("[%s] %s]", a.name, errors.Wrap(err, "failed to push SCTP packet").Error())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.