Created
September 4, 2019 07:19
-
-
Save Sean-Der/5a166e16b5383daf3788a776d7845d60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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