in reply to coderef to an object method

You aren't showing how the callbacks are called. If they are called as methods (i.e.:
$method = $self->{server}->getcallback("data"); $self->$method();
), you can just look up a coderef by method name for an object using can:
...setcallback( data => $self->can("gotdata"), connect => $self->can("connected"), disconnect => $self->can("disconnect") )
If a method isn't available for an object, can will return undef.

If the callbacks are expected to remember what object they belong (i.e. they are called like &{...getcallback("data")}()), use an anonymous sub:

...setcallback( data => sub { $obj->gotdata }, ...