forked from External/ergo
async all write buffer flushes
This commit is contained in:
parent
bffad06a26
commit
5f268e4847
1 changed files with 5 additions and 3 deletions
|
|
@ -78,14 +78,16 @@ func (socket *Socket) Write(line string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
if err = socket.writer.Flush(); socket.isError(err, W) {
|
||||
return
|
||||
}
|
||||
go socket.flush()
|
||||
|
||||
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