mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
async all write buffer flushes
This commit is contained in:
parent
bffad06a26
commit
5f268e4847
@ -78,14 +78,16 @@ func (socket *Socket) Write(line string) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = socket.writer.Flush(); socket.isError(err, W) {
|
go socket.flush()
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.debug.Printf("%s ← %s", socket, line)
|
Log.debug.Printf("%s ← %s", socket, line)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (socket *Socket) flush() {
|
||||||
|
socket.isError(socket.writer.Flush(), W)
|
||||||
|
}
|
||||||
|
|
||||||
func (socket *Socket) isError(err error, dir rune) bool {
|
func (socket *Socket) isError(err error, dir rune) bool {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != io.EOF {
|
if err != io.EOF {
|
||||||
|
Loading…
Reference in New Issue
Block a user