Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gotalk connection close is called after 30 seconds #16

Open
berk-can opened this issue Sep 28, 2021 · 0 comments
Open

Gotalk connection close is called after 30 seconds #16

berk-can opened this issue Sep 28, 2021 · 0 comments

Comments

@berk-can
Copy link

berk-can commented Sep 28, 2021

Hi everyone,
I have server side

gotalk.Handle("connect", func(req model.SubscribeMachineReq) (model.SubscribeMachineReq, error) {
		log.Println("connect received")
		return req, nil
	})
	if err := gotalk.Serve("tcp", "localhost:1234",func (s *gotalk.Sock){}); err != nil {
		log.Println(err.Error())
	}

as well as client side

sock, err := gotalk.Connect("tcp", "localhost:1234")
	if err != nil {
		log.Println("Couldnt connect to streamer 1")
		time.Sleep(time.Second * 10)
		return
	}
	log.Println("Connected to streamer")
	sock.CloseHandler = func(socket *gotalk.Sock, code int) {
		Socket=nil
		log.Println(fmt.Sprintf("Streamer connection is broken with code:%d, retrying...",code))
		time.Sleep(time.Second * 10)
	}

The function I've set as CloseHandler is called after exacly 30 seconds of connection, why is that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant