Add support for port option
Add check to see if $self->{server} is defined before using it
Add read_rpc function to decorrelate read and write function