Neffos provides a wrapper of `neffos.Namespaces` and `neffos.Events` structures to deal with custom Write and Read deadtimes/timeouts, it's the [neffos.WithTimeout](https://github.com/kataras/neffos/blob/59b8198b7dd028b9b34ec1f72ce9c09f9638a76a/conn_handler.go#L57-L68). Its outline looks like this: ```go // WithTimeout completes the `ConnHandler` interface. // Can be used to register namespaces and events or just events on an empty namespace // with Read and Write timeouts. // // See `New` and `Dial`. type WithTimeout struct { ReadTimeout time.Duration WriteTimeout time.Duration Namespaces Namespaces Events Events } ``` It's easy to set timeouts, instead of `var events = neffos.Namespaces{"namespace": neffos.Events: ...}` you just wrap it with `neffos.WithTimeout` like this: ```go var events = neffos.WithTimeout { ReadTimeout: 60 * time.Second, WriteTimeout: 60 * time.Second, Namespaces: neffos.Namespaces { "namespace": neffos.Events { "onMyEvent": func(c *neffos.NSConn, msg neffos.Message) error { // [...] }, }, }, } ``` **or** for empty namespace: ```go var events = neffos.WithTimeout { ReadTimeout: 60 * time.Second, WriteTimeout: 60 * time.Second, Events: neffos.Events { "onMyEvent": func(c *neffos.NSConn, msg neffos.Message) error { // [...] }, }, } ``` ```go websocketServer := neffos.New(gobwas.DefaultUpgrader, events) ``` ```go websocketClient, err := neffos.Dial( context.Background(), gobwas.DefaultDialer, "ws://localhost:8080/echo", events, ) ``` Of cource you could provide those timeouts based on what `Upgrader` and `Dialer` implementations are being used on Server and Client respectfully, i.e the [gorilla](https://github.com/kataras/neffos/blob/59b8198b7dd028b9b34ec1f72ce9c09f9638a76a/gorilla/upgrader.go#L16)'s one has `ReadTimeout` and `WriteTimeout` optional fields that you can set on a custom `gorilla/websocket.Upgrader` structure but if you want a universal way to set your own timeouts in the connection handler level(namespaces, events) use the `neffos.WithTimeout` instead.