Skip to content

Instantly share code, notes, and snippets.

@andreasohlund
Created September 3, 2010 07:38
Show Gist options
  • Save andreasohlund/563553 to your computer and use it in GitHub Desktop.
Save andreasohlund/563553 to your computer and use it in GitHub Desktop.
public class SSSBMessageForwarder : IWantToRunAtStartup
{
readonly IBus _bus;
readonly ITransport _transport;
public SSSBMessageForwarder(IBus bus, ISSSBTransportFactory transportFactory)
{
_bus = bus;
_transport = transportFactory.GetTransport();
_transport.TransportMessageReceived += TransportMessageReceived;
}
void TransportMessageReceived(object sender, TransportMessageReceivedEventArgs e)
{
_bus.SendLocal(e.Message.Body[0]);
}
public void Run()
{
_transport.Start();
}
public void Stop()
{
_transport.Dispose();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment