@@ -72,7 +72,7 @@ func NewEpoller() (*Epoller, error) {
7272 }, nil
7373}
7474
75- // Add creates a epoll console based on the provided console. The console will
75+ // Add creates an epoll console based on the provided console. The console will
7676// be registered with EPOLLET (i.e. using edge-triggered notification) and its
7777// file descriptor will be set to non-blocking mode. After this, user should use
7878// the return console to perform I/O.
@@ -134,7 +134,7 @@ func (e *Epoller) Wait() error {
134134 }
135135}
136136
137- // Close unregister the console's file descriptor from epoll interface
137+ // CloseConsole unregisters the console's file descriptor from epoll interface
138138func (e * Epoller ) CloseConsole (fd int ) error {
139139 e .mu .Lock ()
140140 defer e .mu .Unlock ()
@@ -149,12 +149,12 @@ func (e *Epoller) getConsole(sysfd int) *EpollConsole {
149149 return f
150150}
151151
152- // Close the epoll fd
152+ // Close closes the epoll fd
153153func (e * Epoller ) Close () error {
154154 return unix .Close (e .efd )
155155}
156156
157- // EpollConsole acts like a console but register its file descriptor with a
157+ // EpollConsole acts like a console but registers its file descriptor with an
158158// epoll fd and uses epoll API to perform I/O.
159159type EpollConsole struct {
160160 Console
@@ -167,7 +167,7 @@ type EpollConsole struct {
167167// Read reads up to len(p) bytes into p. It returns the number of bytes read
168168// (0 <= n <= len(p)) and any error encountered.
169169//
170- // If the console's read returns EAGAIN or EIO, we assumes that its a
170+ // If the console's read returns EAGAIN or EIO, we assume that it's a
171171// temporary error because the other side went away and wait for the signal
172172// generated by epoll event to continue.
173173func (ec * EpollConsole ) Read (p []byte ) (n int , err error ) {
@@ -207,7 +207,7 @@ func (ec *EpollConsole) Read(p []byte) (n int, err error) {
207207// written from p (0 <= n <= len(p)) and any error encountered that caused
208208// the write to stop early.
209209//
210- // If writes to the console returns EAGAIN or EIO, we assumes that its a
210+ // If writes to the console returns EAGAIN or EIO, we assume that it's a
211211// temporary error because the other side went away and wait for the signal
212212// generated by epoll event to continue.
213213func (ec * EpollConsole ) Write (p []byte ) (n int , err error ) {
@@ -224,7 +224,7 @@ func (ec *EpollConsole) Write(p []byte) (n int, err error) {
224224 } else {
225225 hangup = (err == unix .EAGAIN || err == unix .EIO )
226226 }
227- // if the other end disappear , assume this is temporary and wait for the
227+ // if the other end disappears , assume this is temporary and wait for the
228228 // signal to continue again.
229229 if hangup {
230230 ec .writec .Wait ()
@@ -242,7 +242,7 @@ func (ec *EpollConsole) Write(p []byte) (n int, err error) {
242242 return n , err
243243}
244244
245- // Close closed the file descriptor and signal call waiters for this fd.
245+ // Shutdown closes the file descriptor and signals call waiters for this fd.
246246// It accepts a callback which will be called with the console's fd. The
247247// callback typically will be used to do further cleanup such as unregister the
248248// console's fd from the epoll interface.
0 commit comments