-
Notifications
You must be signed in to change notification settings - Fork 2
Request Client
Jiowcl edited this page Nov 28, 2021
·
2 revisions
Prepare a request Api key.
string clientRequestKey = "8TAoVPkmYaphto4LFTCtKw==";
object requestParams = new ServerInfoRequest
{
APIKey = clientRequestKey
};
Request a server information from client.
object requestParams = new ServerInfoImpl();
string requestMessage = JsonConvert.SerializeObject(requestParams);
using (RequestSocket client = new RequestSocket("tcp://localhost:5589"))
{
client.SendFrame(requestMessage);
string message = client.ReceiveFrameString();
Console.WriteLine("requestSocket : Received '{0}'", message);
}
Request a server processes information from client.
object requestParams = new ProcessInfoImpl();
string requestMessage = JsonConvert.SerializeObject(requestParams);
using (RequestSocket client = new RequestSocket("tcp://localhost:5589"))
{
client.SendFrame(requestMessage);
string message = client.ReceiveFrameString();
Console.WriteLine("requestSocket : Received '{0}'", message);
}
Request a server managedpackage from client.
object requestParams = new ManagedPackageImpl{
Command = "install git"
};
string requestMessage = JsonConvert.SerializeObject(requestParams);
using (RequestSocket client = new RequestSocket("tcp://localhost:5589"))
{
client.SendFrame(requestMessage);
string message = client.ReceiveFrameString();
Console.WriteLine("requestSocket : Received '{0}'", message);
}