internal override UserToUserResponse ProcessWithEngagement(Engagement engagement, UserToUserRequest req)
 {
     ListenHandshakeRq request = (ListenHandshakeRq)req;
     ListenHandshakeRs response = new ListenHandshakeRs();
     try
     {
         var peerInfo = new PeerInfo()
             {
                 ExternalEndPoint =
                     request.externalEndPoint != null ? new IPEndPoint(IPAddress.Parse(request.externalEndPoint.address),
                                    request.externalEndPoint.port) : null,
             };
         foreach (var ipEndPointElement in request.internalEndPoints)
         {
             peerInfo.InternalEndPoints.Add(new IPEndPoint(IPAddress.Parse(ipEndPointElement.address), ipEndPointElement.port));
         }
         _appContext.P2PManager.ReceiveP2PTunnel(request.uniqueId, peerInfo);
     }
     catch (Exception e)
     {
         Logger.Error("Failed to start listening for UDP traffic from peer : " + e.Message,e);
         response.error = "LISTEN_ERROR";
         response.errorMessage = "Failed to start listening for UDP traffic";
     }
     return response;
 }
Exemple #2
0
 internal override UserToUserResponse ProcessWithEngagement(Engagement engagement, UserToUserRequest req)
 {
     RDPRequestRq request = (RDPRequestRq) req;
     RDPRequestRs response = new RDPRequestRs();
     try
     {
         ((Function)engagement.GetFunction("RemoteDesktop")).ProcessIncomingRemoteDesktopRequest(request.shortCode);
     } catch (Exception e)
     {
         Logger.Error("Failed to process incoming RDP request : " + e.Message,e);
         response.error = "INTERNAL_SERVER_ERROR";
         response.errorMessage = "Failed to process incoming RDP request";
     }
     return response;
 }
 internal override UserToUserResponse ProcessWithEngagement(Engagement engagement, UserToUserRequest req)
 {
     FileSendRequestRq request = (FileSendRequestRq) req;
     FileSendRequestRs response = new FileSendRequestRs();
     try
     {
         ((Function)engagement.GetFunction("FileSend")).ProcessIncomingFileSendRequest(request.filename, request.fileSendId, request.fileSize);
     }
     catch (Exception e)
     {
         Logger.Error("Failed to process incoming File Send request : " + e.Message,e);
         response.error = "UNKNOWN_ERROR";
         response.errorMessage = "Failed to process incoming File Send request";
     }
     return response;
 }
Exemple #4
0
 internal override UserToUserResponse ProcessWithEngagement(Engagement engagement, UserToUserRequest req)
 {
     ChatMessageRq request = (ChatMessageRq)req;
     ChatMessageRs response = new ChatMessageRs();
     try
     {
         ((Function)engagement.Functions["Chat"]).ReceiveChatMessage(request.message, request.chatId, request.interactionId, request.shortCode,request.username);
     }
     catch (Exception e)
     {
         Logger.Error("Failed to process chat message : " + e.Message,e);
         response.error = "UNKNOWN_ERROR";
         response.errorMessage = "Failed to process Chat request";
     }
     return response;
 }
 internal override UserToUserResponse ProcessWithEngagement(Engagement engagement, UserToUserRequest req)
 {
     FileSendRequestResponseRq request = (FileSendRequestResponseRq)req;
     FileSendRequestResponseRs response = new FileSendRequestResponseRs();
     try
     {
         ((Function)engagement.GetFunction("FileSend")).ProcessFileSendRequestResponse(request.accepted,request.fileSendId);
     }
     catch (Exception e)
     {
         Logger.Error("Failed to process incoming FileSend request response : " + e.Message, e);
         response.error = "INTERNAL_SERVER_ERROR";
         response.errorMessage = "Failed to process incoming FileSend request response";
     }
     return response;
 }
 internal override UserToUserResponse ProcessWithEngagement(Engagement engagement, UserToUserRequest rq)
 {
     var request = (InitRepeatedConnectionRq) rq;
     Logger.Debug("Got a request to connect to a repeated connection from " + rq.username + ", with id " + request.repeatId);
     return new InitRepeatedConnectionRs();
 }
Exemple #7
0
 internal abstract UserToUserResponse ProcessWithEngagement(Engagement engagement, UserToUserRequest request);