Mercurial > hg > ucis.core
diff Pml/IPmlCommunicator.cs @ 0:3ab940a0c7a0
Initial commit
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Tue, 11 Sep 2012 16:28:53 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Pml/IPmlCommunicator.cs Tue Sep 11 16:28:53 2012 +0200 @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace UCIS.Pml { + public class PmlCallReceivedEventArgs : EventArgs { + private PmlElement _request; + private PmlElement _reply; + private UInt32 _sid; + private bool _wantReply; + + internal PmlCallReceivedEventArgs(PmlElement request, bool wantReply, UInt32 sid) { + _request = request; + _wantReply = wantReply; + _sid = sid; + _reply = null; + } + public bool WantReply { + get { return _wantReply; } + } + internal UInt32 SID { + get { return _sid; } + } + public PmlElement Reply { + get { return _reply; } + set { _reply = value; } + } + public PmlElement Request { + get { return _request; } + } + } + public abstract class PmlChannelRequestReceivedEventArgs : EventArgs { + public abstract IPmlChannel Accept(); + public abstract void Reject(); + public abstract PmlElement Data { get; } + } + public interface IPmlCommunicator { + event EventHandler<PmlCallReceivedEventArgs> CallReceived; + event EventHandler<PmlChannelRequestReceivedEventArgs> ChannelRequestReceived; + + void Call(PmlElement message); + PmlElement Invoke(PmlElement message); + + IAsyncResult BeginInvoke(PmlElement message, AsyncCallback callback, Object state); + PmlElement EndInvoke(IAsyncResult result); + + IPmlChannel CreateChannel(PmlElement data); + IAsyncResult BeginCreateChannel(PmlElement data, AsyncCallback callback, Object state); + IPmlChannel EndCreateChannel(IAsyncResult result); + } +}