Skip to content

Commit af8d230

Browse files
committed
made portInUse public
1 parent 6bf02c2 commit af8d230

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func NewServerWithHandler(
113113
return newServerFromHandler(cfg, e, sm, handler, listener)
114114
}
115115

116-
func portInUse(hostPort string) bool {
116+
func PortInUse(hostPort string) bool {
117117
timeout := time.Second
118118
conn, _ := net.DialTimeout("tcp", hostPort, timeout)
119119
if conn != nil {
@@ -166,7 +166,7 @@ func newServerFromHandler(cfg Config, e *sqle.Engine, sm *SessionManager, handle
166166
l := cfg.Listener
167167
var unixSocketInUse error
168168
if l == nil {
169-
if portInUse(cfg.Address) {
169+
if PortInUse(cfg.Address) {
170170
unixSocketInUse = fmt.Errorf("Port %s already in use.", cfg.Address)
171171
}
172172

0 commit comments

Comments
 (0)