Emudofus / gofus

Dofus 1.29 emulator written in Golang
7 stars 3 forks source link

Use close_conn(ctx, client) instead of client.Close() #2

Closed hmaurer closed 11 years ago

hmaurer commented 11 years ago

client.Close() doesn't dispatch any event, nor allows some kind of teardown procedure when a client is disconnected. Use close_conn(ctx, client) instead.

volgar1x commented 11 years ago

But it will stop the handle_conn's loop (conn.Recv will return an io.EOF error) which will invoke close_conn (because of the defer instruction).