public function requestByServer($server, $data, $onResponse = null)
    {
        $this->getConnection($server, function ($conn) use ($data, $onResponse) {
            if (!$conn->isConnected()) {
                return;
            }
            $conn->onResponse($onResponse);
            $conn->write($data);
        });
        return true;
    }
public function requestByServer($server, $data, $onResponse = null)
    {
        $this->getConnection($server, function ($conn) use ($data, $onResponse) {
            if (!$conn->isConnected()) {
                return;
            }
            $conn->onResponse($onResponse);
            $conn->write($data);
        });
        return true;
    }
public function requestByServer ( $ server , $ data , $ onResponse = null ) { $ this -> getConnection ( $ server , function ( $ conn ) use ( $ data , $ onResponse ) { if ( ! $ conn -> isConnected ( ) ) { return ; } $ conn -> onResponse ( $ onResponse ) ; $ conn -> write ( $ data ) ; } ) ; return true ; }
Sends a request to arbitrary server
@param  string $server Server
@param  string $data Data
@param  callable $onResponse Called when the request complete
@callback $onResponse ( )
@return boolean              Success
Sends a request to arbitrary server