Skip to content

Commit

Permalink
Remove unused member in SCTPTransport
Browse files Browse the repository at this point in the history
RTOMax wasn't actually being stored, is being pulled directly from
SettingEngine
  • Loading branch information
Sean-Der committed Mar 18, 2024
1 parent 313ca8c commit 5d7c2bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions sctptransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ type SCTPTransport struct {

api *API
log logging.LeveledLogger
// maximum retransmission timeout
rtoMax float64
}

// NewSCTPTransport creates a new SCTPTransport.
Expand Down Expand Up @@ -107,13 +105,12 @@ func (r *SCTPTransport) Start(SCTPCapabilities) error {
if dtlsTransport == nil || dtlsTransport.conn == nil {
return errSCTPTransportDTLS
}
rtoMax := float64(r.api.settingEngine.sctp.rtoMax) / float64(time.Millisecond)
sctpAssociation, err := sctp.Client(sctp.Config{
NetConn: dtlsTransport.conn,
MaxReceiveBufferSize: r.api.settingEngine.sctp.maxReceiveBufferSize,
EnableZeroChecksum: r.api.settingEngine.sctp.enableZeroChecksum,
LoggerFactory: r.api.settingEngine.LoggerFactory,
RTOMax: rtoMax,
RTOMax: float64(r.api.settingEngine.sctp.rtoMax) / float64(time.Millisecond),
})
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion settingengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ func (e *SettingEngine) SetSCTPMaxReceiveBufferSize(maxReceiveBufferSize uint32)
e.sctp.maxReceiveBufferSize = maxReceiveBufferSize
}

// SetSCTPZeroChecksum enables the zero checksum feature in SCTP.
// EnableSCTPZeroChecksum controls the zero checksum feature in SCTP.
// This removes the need to checksum every incoming/outgoing packet and will reduce
// latency and CPU usage. This feature is not backwards compatible so is disabled by default
func (e *SettingEngine) EnableSCTPZeroChecksum(isEnabled bool) {
Expand Down

0 comments on commit 5d7c2bf

Please sign in to comment.