Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

Commit

Permalink
tls+tcp: support underlying TCP transport options (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit Renker authored and Gerrit Renker committed Apr 11, 2019
1 parent 23b260d commit 1f0e2e7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions transport/tlstcp/tlstcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ func (o options) get(name string) (interface{}, error) {

func (o options) set(name string, val interface{}) error {
switch name {
case mangos.OptionNoDelay:
fallthrough
case mangos.OptionKeepAlive:
switch v := val.(type) {
case bool:
o[name] = v
return nil
default:
return mangos.ErrBadValue
}
case mangos.OptionKeepAliveTime:
switch v := val.(type) {
case time.Duration:
if v.Nanoseconds() >= 0 {
o[name] = v
return nil
} else {
return mangos.ErrBadValue
}
default:
return mangos.ErrBadValue
}
case mangos.OptionTLSConfig:
switch v := val.(type) {
case *tls.Config:
Expand Down

0 comments on commit 1f0e2e7

Please sign in to comment.