I am trying to call a method from another. Dll file. It sends a message through the VPN, and then returns the received message from another computer.
As you now need time to send and receive a message, VpnObjectjust send a message, and I have to wait for the listener to call RecievedMessage.
This method is similar to this one!
public string RecievedMessage()
{
string Recieved ;
return Recieved;
}
public string SendAndRecieveMessage(string MessageToSend)
{
string RecievedAnswer = string.Empty;
VpnObject.SendMessage(MessageToSend);
return RecievedAnswer;
}
I just think how to wait RecievedMessagefor the call and then return the result.
You know that just using a variable and assigning it a value and checking for while, but it drastically reduced performance.
Do I need to continue working with SendAndRecieveMessageonly after a call RecievedMessage? (I think this is something asynchronous and waiting, but I don’t know how!)
: VpnObject - vpn. , (RecievedMessage) .