Beispiel #1
0
  public boolean connectionRequest(DatagramPacket aDatagramPacket) {

    if (aDatagramPacket.getSocketAddress().equals(mSocketAddress)) {

      String vXMLString = new String(aDatagramPacket.getData(), 0, aDatagramPacket.getLength());

      GraphicsManagement.getLogger()
          .debug(
              "Connection request ("
                  + ((InetSocketAddress) aDatagramPacket.getSocketAddress()).toString()
                  + "):"
                  + vXMLString);
      ConnectionRequest vConnectionRequest =
          ConnectionRequest.unmarshallXMLConnectionRequestString(vXMLString);

      if (vConnectionRequest != null) {

        mClientName = vConnectionRequest.getClientGraphicsName();

        String vAcknowlegeRequest =
            (new ConnectionAcknowlege(
                    Core.getInstance().getServerConfig().getServerName(), mClientName, true))
                .toXMLString();

        mGraphicsConnection.sendString(vAcknowlegeRequest, mSocketAddress);

        return true;
      }
    }

    return false;
  }
Beispiel #2
0
  public void sendData(String aData) {

    mGraphicsConnection.sendString(aData, mSocketAddress);
  }