Passing message over network
- by Sylvestre Equy
Hi,
I'm currently trying to develop a message-oriented networking framework and I'm a bit stuck on the internal mechanism.
Here are the problematic interfaces :
public interface IMessage
{
}
public class Connection
{
public void Subscribe<TMessage>(Action<TMessage> messageCallback);
public void Send<TMessage>(TMessage message);
}
The Send method does not seem complicated, though the mechanism behind Subscribe seems a bit more painful.
Obviously when receiving a message on one end of the connection, I'll have to invoke the appropriate delegate.
Do you have any advice on how to read messages and easily detect their types ?
By the way, I'd like to avoid to use MSMQ.