Handle operation with automatic JSON encoding of values.

`fn` must conform to one of the following signatures:

func(*Sock, string, interface{}) (interface{}, error) -- takes socket, op and parameters
func(*Sock, interface{}) (interface{}, error)         -- takes socket and parameters
func(interface{}) (interface{}, error)                -- takes parameters, but no socket
func(*Sock) (interface{}, error)                      -- takes no parameters
func() (interface{},error)                            -- takes no socket or parameters

Where optionally the `interface{}` return value can be omitted, i.e:

func(*Sock, string, interface{}) error
func(*Sock, interface{}) error
func(interface{}) error
func(*Sock) error
func() error

If `op` is empty, handle all requests which doesn't have a specific handler registered.

Handle is referenced in 5 repositories