|
@@ -304,6 +304,10 @@ func (d *Door) GetKey() int {
|
|
|
return c
|
|
|
}
|
|
|
|
|
|
+func (d *Door) Key() int {
|
|
|
+ return d.WaitKey(Inactivity, 0)
|
|
|
+}
|
|
|
+
|
|
|
func (d *Door) WaitKey(secs int64, usecs int64) int {
|
|
|
if d.Disconnected {
|
|
|
return -2
|
|
@@ -323,12 +327,17 @@ func (d *Door) WaitKey(secs int64, usecs int64) int {
|
|
|
if v == -1 {
|
|
|
errno, ok := err.(syscall.Errno)
|
|
|
if ok && errno == syscall.EINTR {
|
|
|
+ // Should I retry my syscall.Select here?
|
|
|
return -1
|
|
|
}
|
|
|
|
|
|
- // Interrupted system call ??? What does this mean?
|
|
|
- // This isn't hangup. I'm still connected.
|
|
|
- // -1 : interrupted system call
|
|
|
+ /*
|
|
|
+ Interrupted system call ??? What does this mean?
|
|
|
+ This isn't hangup. I'm still connected.
|
|
|
+ -1 : interrupted system call
|
|
|
+ This seemed to happen when I called WaitKey many times with usecs.
|
|
|
+ */
|
|
|
+
|
|
|
fmt.Println("-1 : ", err)
|
|
|
// hangup ?!
|
|
|
return -2
|