| Paste number 67861: | C# OTP.NET Test |
| Pasted by: | daws |
| When: | 1 year, 10 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+1GD1 |
| Channel: | None |
| Paste contents: |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Otp;
namespace ErlTestClient
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
OtpSelf self = new OtpSelf("client@localhost", "abc123");
OtpPeer server = new OtpPeer("server@localhost");
OtpConnection connection = server.connect(self);
Otp.Erlang.Object[] args = new Otp.Erlang.Object[] {
new Otp.Erlang.Long(int.Parse(textBox1.Text)),
new Otp.Erlang.Long(int.Parse(textBox2.Text))
};
connection.sendRPC("otp_net_test", "multiply", args);
Otp.Erlang.Long total = (Otp.Erlang.Long)connection.receiveRPC();
MessageBox.Show(String.Format("{0} *{1} = {2}", textBox1.Text, textBox2.Text, total.intValue()));
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
}This paste has no annotations.