diff --git a/rpc/connectedport.go b/rpc/connectedport.go index 8fca9f8..6269dfc 100644 --- a/rpc/connectedport.go +++ b/rpc/connectedport.go @@ -136,6 +136,10 @@ func (port *ConnectedPort) SendLocal(data []byte) (err error) { } conn = port.Conn }) + if err != nil { + port.Close() + return + } _, err = conn.Write(data) if err != nil { port.Close()