couple of enhancement and bug fixes

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