attachmentPath = $attachmentPath; } protected function openConnection(){ $service_port = getservbyname('rapi', 'tcp'); $address = RAPI_Config::RAPI_SERVER_ADDRESS; $this->fh = stream_socket_client("tcp://$address:$service_port", $errno, $errstr, 30); } protected function closeConnection(){ fclose($this->fh); } protected function sendMessage($msg){ fwrite($this->fh, $msg); } protected function getMessage($bufferSize = null){ if (is_null($bufferSize)){ return fgets($this->fh); } else { return fgets($this->fh,$bufferSize); } } protected function getReceivedAttachmentPath(){ return $this->attachmentPath; } } ?>