Skip to content

Instantly share code, notes, and snippets.

@workmaster2n
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save workmaster2n/c7df734a11f723c32f7b to your computer and use it in GitHub Desktop.
Save workmaster2n/c7df734a11f723c32f7b to your computer and use it in GitHub Desktop.
public partial class Form1 : Form
{
IRemoteEvents remoteServer;
RemoteEventsProxy remoteEventsProxy;
TcpChannel tcpChan;
BinaryClientFormatterSinkProvider clientProv;
BinaryServerFormatterSinkProvider serverProv;
private string serverURI = "tcp://localhost:1551/QTrackRemoteEvents.Rem";
string m_Text = string.Empty;
int m_MeasurementCount = 0;
int m_SolutionCount = 0;
PointF m_Position = new PointF();
OnNewSolutionCalculatedDelegate NewSolutionCalculatedDelegateLocal;
OnNewSolutionCalculatedDelegate NewSolutionCalculatedDelegateRemote;
private void Connect(){
try{
NewSolutionCalculatedDelegateLocal = new OnNewSolutionCalculatedDelegate(MyNewSolutionCalculatedHandler);
remoteEventsProxy.NewSolutionCalculated += NewSolutionCalculatedDelegateLocal;
NewSolutionCalculatedDelegateRemote = new OnNewSolutionCalculatedDelegate(remoteEventsProxy.NewSolutionCalculatedHandler);
remoteServer.NewSolutionCalculated += NewSolutionCalculatedDelegateRemote;
}
}
void MyNewSolutionCalculatedHandler(Tag tag)
{
//Here is where we would construct the message. tag has everything we need
m_SolutionCount++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment