1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
[WebMethod]
public IAsyncResult testAdd(int i1, int i2, AsyncCallback callback, object asyncState)
{
try
{
Dictionary<string, int> argsDic = new Dictionary<string, int>();
argsDic.Add("i1", i1);
argsDic.Add("i2", i2);
string jsonArgsDic = JsonConvert.SerializeObject(argsDic);
PipeClient pipeClient = new PipeClient();
pipeClient.Send(jsonArgsDic, "pipe_in", 1000);
PipeServer pipeServer = new PipeServer();
pipeServer.Listen("pipe_out", delegate(string sum)
{
// On retourne la réponse parsée
// ??(int.Parse(sum));
});
}
catch (Exception ex)
{
Console.WriteLine( ex.Message );
}
} |
Partager