forked from External/ergo
don't async buffer flushing
This commit is contained in:
parent
78b787f3ae
commit
142bf3d3bb
2 changed files with 4 additions and 6 deletions
|
|
@ -74,16 +74,14 @@ func (socket *Socket) Write(line string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
go socket.flush()
|
||||
if err = socket.writer.Flush(); socket.isError(err, W) {
|
||||
return
|
||||
}
|
||||
|
||||
Log.debug.Printf("%s ← %s", socket, line)
|
||||
return
|
||||
}
|
||||
|
||||
func (socket *Socket) flush() {
|
||||
socket.isError(socket.writer.Flush(), W)
|
||||
}
|
||||
|
||||
func (socket *Socket) isError(err error, dir rune) bool {
|
||||
if err != nil {
|
||||
if err != io.EOF {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue