ref: makes correction to SCTPConn close logic for SCTPWrite#87
ref: makes correction to SCTPConn close logic for SCTPWrite#87gomaja wants to merge 7 commits intoishidawataru:masterfrom
Conversation
|
@ishidawataru after the fix, the c.SCTPWrite(nil, info) is returning an error "invalid argument" I think SCTPWrite can be removed completely from Close. |
|
This code part "defer" after an error with close is not performing well in dialSCTPExtConfig, specifically when SCTPConnect is returning one of the errors (syscall.EISCONN, syscall.EALREADY, syscall.EINPROGRESS). Mostly syscall.EINPROGRESS. |
b5ed2cc to
b2960c6
Compare
|
PR ready for review,. Changes have made operation very smooth as previously it was very faulty specifically when the connection sends to a backhole (peer no more reachable) while having many messages to send (Full send-Q). Later we can refactor syscall.SendmsgN(c.fd(), b, cbuf, nil, syscall.MSG_DONTWAIT) to a better one. |
Here is a PR that makes a correction to Close
fd := atomic.SwapInt32(&c._fd, -1) // fd = old value, c._fd = -1
c.SCTPWrite(nil, info) // BROKEN: uses c.fd() which returns -1