percipia / eslgo

A GoLang FreeSWITCH ESL Library
Mozilla Public License 2.0
103 stars 43 forks source link

fix: If SetWriteDeadline is set, set it back later #35

Closed button-chen closed 1 month ago

button-chen commented 1 month ago

Code: ctx, _:= context.WithTimeout(context.Background(), *2time.Second) response, err := conn.SendCommand(ctx**, ...)

// do something, after 2 seconds

response, err := conn.SendCommand(context.Background(), ...)
At this point, err is io write timeout

The cause of this problem is that the SetWriteDeadline is not set back

button-chen commented 1 month ago

@mkravos hi bro, can you take a look at this pr?

mkravos commented 1 month ago

Nice! Merged.