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

The time to wait for the connection to be made in milliseconds. #3312

Merged
merged 1 commit into from
Oct 23, 2021

Conversation

c77cc
Copy link

@c77cc c77cc commented Oct 20, 2021

The time to wait for the connection to be made in
milliseconds. A negative number waits forever.

The default is zero, don't wait, which is useful if a local
server is supposed to be running already. On Unix Vim
actually uses a 1 msec timeout, that is required on many
systems. Use a larger value for a remote server, e.g. 5000 msec.

The default is zero, don't wait, which is useful if a local server is supposed to be running already.
Use a larger value for a remote server.
@bhcleek
Copy link
Collaborator

bhcleek commented Oct 20, 2021

The server should already be running by the time ch_open is called, and I've never seen a need to set waittime. Does this fix some bug that you've seen?

@c77cc
Copy link
Author

c77cc commented Oct 21, 2021

The server should already be running by the time ch_open is called, and I've never seen a need to set waittime. Does this fix some bug that you've seen?

Yes, when I debug the remote process, the local vim will quickly receive the connection failure error(could not connect to debugger).
When I fix the waittime of ch_open, the connection failure error disappears, then I can successfully debug.

https://vimhelp.org/channel.txt.html#waittime (Use a larger value for a remote server)

@bhcleek
Copy link
Collaborator

bhcleek commented Oct 21, 2021

What remote process are you debugging? I'd normally expect the dlv process that vim-go is communicating with to be local.

@c77cc
Copy link
Author

c77cc commented Oct 21, 2021

What remote process are you debugging? I'd normally expect the dlv process that vim-go is communicating with to be local.

The code of the remote process (running on another physical machine) is:

package main

import (
	"fmt"
	"time"
)

func main() {
	msg := `test_msg`

	fmt.Println(msg)

	time.Sleep(1 * time.Hour)
}
dlv exec ./main --listen=7001 --headless --api-version=2 --log --log-output=rpc,debugger

@bhcleek
Copy link
Collaborator

bhcleek commented Oct 21, 2021

What's your g:go_debug_address set to?

@c77cc
Copy link
Author

c77cc commented Oct 21, 2021

I did not set g:go_debug_address.
I did it in vim like this: GoDebugConnect {REAL_IP}:{REAL_PORT}

@bhcleek bhcleek added this to the vim-go 1.26 milestone Oct 23, 2021
@bhcleek bhcleek merged commit f4ed057 into fatih:master Oct 23, 2021
bhcleek added a commit that referenced this pull request Oct 23, 2021
@bhcleek
Copy link
Collaborator

bhcleek commented Oct 23, 2021

Thank you for contributing.

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

Successfully merging this pull request may close these issues.

2 participants