Skip to content

Commit

Permalink
gh-84 sctp-connect probing support #2
Browse files Browse the repository at this point in the history
  • Loading branch information
TrekkieCoder committed May 9, 2023
1 parent 1138f50 commit 20fc97e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/loxilb-io/loxilib

go 1.17

require github.com/loxilb-io/sctp v0.0.0-20230509050318-6f6941e1d029 // indirect
require github.com/loxilb-io/sctp v0.0.0-20230509050318-6f6941e1d029
13 changes: 7 additions & 6 deletions serviceprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
package loxilib

import (
"github.com/loxilb-io/sctp"
"net"
"net/http"
"strconv"
"strings"
"time"

"github.com/loxilb-io/sctp"
)

// HTTPProber - Do a http probe for given url
Expand Down Expand Up @@ -38,17 +39,17 @@ func L4ServiceProber(sType string, sName string) bool {
if sType == "sctp" {
svcPair := strings.Split(sName, ":")
if len(svcPair) != 2 {
return sOk
return false
}

svcPort, err := strconv.Atoi(svcPair[1])
if err == nil {
return sOk
if err != nil {
return false
}

epIp, err := net.ResolveIPAddr("ip", svcPair[0])
if err == nil {
return sOk
if err != nil {
return false
}

ips := []net.IPAddr{*epIp}
Expand Down

0 comments on commit 20fc97e

Please sign in to comment.