Skip to content

Commit

Permalink
Merge pull request #12 from EDDxample/master
Browse files Browse the repository at this point in the history
Fix windows build
  • Loading branch information
smallnest authored Sep 23, 2024
2 parents 5857d74 + 3873faa commit 664c29a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions wepoll/epoll_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (e *Epoll) Add(conn net.Conn) error {
if err == -1 {
return errors.New("C.EPOLL_CTL_ADD error ")
}
e.connections[int(fd)] = conn
e.conns[int(fd)] = conn
return nil
}

Expand All @@ -86,7 +86,7 @@ func (e *Epoll) Remove(conn net.Conn) error {
}
e.lock.Lock()
defer e.lock.Unlock()
delete(e.connections, int(fd))
delete(e.conns, int(fd))
return nil
}

Expand All @@ -109,7 +109,7 @@ func (e *Epoll) Wait(count int) ([]net.Conn, error) {
e.lock.RLock()
for i := 0; i < int(n); i++ {
fd := C.get_epoll_event(events[i])
conn := e.connections[int(fd)]
conn := e.conns[int(fd)]
if conn != nil {
conns = append(conns, conn)
}
Expand All @@ -131,8 +131,6 @@ func socketFDAsUint(conn net.Conn) uint64 {
sfd = uint64(fd)
})
return sfd
} else if con, ok := conn.(ConnImpl); ok {
return conn.GetFD()
}
return 0
}

0 comments on commit 664c29a

Please sign in to comment.