Skip to content

Instantly share code, notes, and snippets.

@mikeacjones
Created May 15, 2020 14:52
Show Gist options
  • Save mikeacjones/eab0fb22cfd3b26165a3e0dfa2c9fe75 to your computer and use it in GitHub Desktop.
Save mikeacjones/eab0fb22cfd3b26165a3e0dfa2c9fe75 to your computer and use it in GitHub Desktop.
#region ServiceBase
protected override void OnStart(string[] args)
{
base.OnStart(args);
_MicrosInterface = new MicrosInterface(MicrosMessageHandler, Properties.Settings.Default.ListenPort, Properties.Settings.Default.InterfaceMessageExpected);
_MicrosInterface.Start();
}
protected override void OnStop()
{
base.OnStop();
_MicrosInterface.Stop();
_MicrosInterface.Dispose();
}
protected override void OnContinue()
{
base.OnContinue();
_MicrosInterface.Start();
}
protected override void OnPause()
{
base.OnShutdown();
_MicrosInterface.Stop();
}
#endregion
#region Online Order Monitor Handlers
private MicrosMessage MicrosMessageHandler(MicrosMessage microsMessage)
{
return microsMessage.CreateReply("ERROR", "An Unknown Error Has Occured");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment