Created
September 3, 2010 07:38
-
-
Save andreasohlund/563553 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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