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

windows not close event #56

Open
wildfire810 opened this issue Apr 2, 2017 · 3 comments
Open

windows not close event #56

wildfire810 opened this issue Apr 2, 2017 · 3 comments

Comments

@wildfire810
Copy link

func (p *Port) Close() error {
return p.f.Close()
}

func newOverlapped() (*syscall.Overlapped, error) {
var overlapped syscall.Overlapped
r, _, err := syscall.Syscall6(nCreateEvent, 4, 0, 1, 0, 0, 0, 0)
if r == 0 {
return nil, err
}
overlapped.HEvent = syscall.Handle(r)
return &overlapped, nil
}

@eohome
Copy link

eohome commented Aug 30, 2017

the same question,anyone who fixed it

@andarm
Copy link

andarm commented Jul 26, 2018

	s, err := serial.OpenPort(c)
	if err != nil {
		s.Close()
		log.Fatal(err)
	}
	defer s.Close()

solve it .

@plopezm
Copy link

plopezm commented Jun 27, 2019

I have the same problem, sometimes, when close() is executed, the library blocks the application waiting for something

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

4 participants