/// <summary>
        /// The HeaderReceived.
        /// </summary>
        /// <param name="inetdealcontext">The inetdealcontext<see cref="object"/>.</param>
        /// <returns>The <see cref="object"/>.</returns>
        public object HeaderReceived(object inetdealcontext)
        {
            string clientEcho = ((ITransferContext)inetdealcontext).Transfer.HeaderReceived.Context.Echo;

            WriteEcho(string.Format("Client header received"));
            if (clientEcho != null && clientEcho != "")
            {
                WriteEcho(string.Format("Client echo: {0}", clientEcho));
            }

            DealContext trctx = ((ITransferContext)inetdealcontext).Transfer.MyHeader.Context;

            if (trctx.Echo == null || trctx.Echo == "")
            {
                trctx.Echo = "Server say Hello";
            }
            if (!((ITransferContext)inetdealcontext).Synchronic)
            {
                server.Send(MessagePart.Header, ((ITransferContext)inetdealcontext).Id);
            }
            else
            {
                server.Receive(MessagePart.Message, ((ITransferContext)inetdealcontext).Id);
            }

            return((ITransferContext)inetdealcontext);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DealManager"/> class.
 /// </summary>
 /// <param name="dealTransfer">The dealTransfer<see cref="DealTransfer"/>.</param>
 public DealManager(DealTransfer dealTransfer)
 {
     transfer        = dealTransfer;
     transferContext = dealTransfer.Context;
     dealContext     = dealTransfer.MyHeader.Context;
     site            = dealContext.IdentitySite;
 }
        private DealManager treatment;// Important Field !!! - Dealer Treatment initiatie, filtering, sorting, saving, editing all treatment here.

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="TransferManager"/> class.
        /// </summary>
        /// <param name="_transaction">The _transaction<see cref="DealTransfer"/>.</param>
        public TransferManager(DealTransfer _transaction)
        {
            transaction     = _transaction;
            transferContext = transaction.Context;
            context         = transaction.MyHeader.Context;
            site            = context.IdentitySite;
            treatment       = new DealManager(_transaction);
        }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DealHeader"/> class.
 /// </summary>
 /// <param name="_transaction">The _transaction<see cref="DealTransfer"/>.</param>
 /// <param name="identity">The identity<see cref="MemberIdentity"/>.</param>
 public DealHeader(DealTransfer _transaction, MemberIdentity identity)
 {
     Context              = new DealContext();
     Context.Identity     = identity;
     Context.IdentitySite = identity.Site;
     transaction          = _transaction;
     SerialCount          = 0; DeserialCount = 0;
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DealHeader"/> class.
 /// </summary>
 /// <param name="_transaction">The _transaction<see cref="DealTransfer"/>.</param>
 /// <param name="context">The context<see cref="ITransferContext"/>.</param>
 public DealHeader(DealTransfer _transaction, ITransferContext context)
 {
     Context = new DealContext();
     Context.LocalEndPoint  = (IPEndPoint)context.Listener.LocalEndPoint;
     Context.RemoteEndPoint = (IPEndPoint)context.Listener.RemoteEndPoint;
     transaction            = _transaction;
     SerialCount            = 0; DeserialCount = 0;
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DealHeader"/> class.
 /// </summary>
 /// <param name="_transaction">The _transaction<see cref="DealTransfer"/>.</param>
 /// <param name="context">The context<see cref="ITransferContext"/>.</param>
 /// <param name="identity">The identity<see cref="MemberIdentity"/>.</param>
 public DealHeader(DealTransfer _transaction, ITransferContext context, MemberIdentity identity)
 {
     Context = new DealContext();
     Context.LocalEndPoint  = (IPEndPoint)context.Listener.LocalEndPoint;
     Context.RemoteEndPoint = (IPEndPoint)context.Listener.RemoteEndPoint;
     Context.Identity       = identity;
     Context.IdentitySite   = identity.Site;
     transaction            = _transaction;
     SerialCount            = 0; DeserialCount = 0;
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TransferOperation"/> class.
 /// </summary>
 /// <param name="_transaction">The _transaction<see cref="DealTransfer"/>.</param>
 /// <param name="_part">The _part<see cref="MessagePart"/>.</param>
 /// <param name="_direction">The _direction<see cref="DirectionType"/>.</param>
 public TransferOperation(DealTransfer _transaction, MessagePart _part, DirectionType _direction)
 {
     transaction      = _transaction;
     transferContext  = transaction.Context;
     transportContext = transaction.MyHeader.Context;
     site             = transportContext.IdentitySite;
     direction        = _direction;
     part             = _part;
     protocol         = transferContext.Protocol;
     method           = transferContext.Method;
 }
Exemple #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DealHeader"/> class.
 /// </summary>
 /// <param name="_transaction">The _transaction<see cref="DealTransfer"/>.</param>
 public DealHeader(DealTransfer _transaction)
 {
     Context     = new DealContext();
     transaction = _transaction;
     SerialCount = 0; DeserialCount = 0;
 }
Exemple #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DealHeader"/> class.
 /// </summary>
 public DealHeader()
 {
     Context     = new DealContext();
     SerialCount = 0; DeserialCount = 0;
 }