Skip to content

Commit

Permalink
Merge pull request #320 from ellemouton/mailboxKeepAlivePing
Browse files Browse the repository at this point in the history
session: add 2 min mailbox ping
  • Loading branch information
guggero authored Feb 8, 2022
2 parents 954daad + 511be4f commit 2ca94d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions session/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import (
"crypto/tls"
"fmt"
"sync"
"time"

"github.com/btcsuite/btcd/btcec"
"github.com/lightninglabs/lightning-node-connect/mailbox"
"github.com/lightningnetwork/lnd/keychain"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/keepalive"
)

type sessionID [33]byte
Expand Down Expand Up @@ -41,6 +43,9 @@ func (m *mailboxSession) start(session *Session,
mailboxServer, err := mailbox.NewServer(
session.ServerAddr, session.PairingSecret[:],
grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig)),
grpc.WithKeepaliveParams(keepalive.ClientParameters{
Time: 2 * time.Minute,
}),
)
if err != nil {
return err
Expand Down

0 comments on commit 2ca94d2

Please sign in to comment.