コード例 #1
0
 public IPCSyncHelperMessage(string ownerFullUri, Type ownerType, IIPCGUID id)
     : base(id)
 {
     RealMessageID = id;
     OwnerType     = ownerType;
     OwnerFullUri  = ownerFullUri;
 }
コード例 #2
0
 public IPCSyncHelperMessage(string ownerFullUri, Type ownerType, IIPCGUID id)
     : base(id)
 {
     RealMessageID = id;
     OwnerType = ownerType;
     OwnerFullUri = ownerFullUri;
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: jjchoi/SimpleIPCCommSystem
 private static void ForwardResponce(IIPCMessage message, IIPCGUID receaver)
 {
     using (BaseIPCDispatcher dispatcher = new BaseIPCDispatcher(receaver)) {
             if (dispatcher.Dispatch(message) == IPCDispatchResult.Success)
                 Console.WriteLine("Message has been forwarded succesfully!");
             else
                 Console.WriteLine("Unable to forward message");
         }
 }
コード例 #4
0
 private static void ForwardResponce(IIPCMessage message, IIPCGUID receaver)
 {
     using (BaseIPCDispatcher dispatcher = new BaseIPCDispatcher(receaver)) {
         if (dispatcher.Dispatch(message) == IPCDispatchResult.Success)
         {
             Console.WriteLine("Message has been forwarded succesfully!");
         }
         else
         {
             Console.WriteLine("Unable to forward message");
         }
     }
 }
コード例 #5
0
 public BaseIPCDispatcher(IIPCGUID receaverID)
 {
     // create receaver wait handle
     _receaverID = receaverID;
     _receaverWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset,
         _receaverID.Value);
     // create dispatcher wait handle
     _dispatcherID = new IPCDispatcherGUID();
     _dispatcherWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset,
         _dispatcherID.Value);
     if (!ChannelServices.RegisteredChannels.Any(i => i == clientChannel)) {
         ChannelServices.RegisterChannel(clientChannel, true);
     }
 }
コード例 #6
0
 public BaseIPCDispatcher(IIPCGUID receaverID)
 {
     // create receaver wait handle
     _receaverID         = receaverID;
     _receaverWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset,
                                               _receaverID.Value);
     // create dispatcher wait handle
     _dispatcherID         = new IPCDispatcherGUID();
     _dispatcherWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset,
                                                 _dispatcherID.Value);
     if (!ChannelServices.RegisteredChannels.Any(i => i == clientChannel))
     {
         ChannelServices.RegisterChannel(clientChannel, true);
     }
 }
コード例 #7
0
        public BaseIPCReceaver()
        {
            _ownGUID = new IPCReceaverGUID();
            _currentWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset,
                 _ownGUID.Value);
            _currentQueue = DoCreateQueue();

            // do not use security
            // ensure that IPC server is alive
            if (!ChannelServices.RegisteredChannels.Any(i => i.ChannelName == _ownGUID.Value)) {
                channel = new IpcServerChannel(_ownGUID.Value, _ownGUID.Value);
                if (!ChannelServices.RegisteredChannels.Any(i => i == channel)) {
                    ChannelServices.RegisterChannel(channel, false);
                }
            }

            RemotingServices.Marshal(_currentQueue,
                _currentQueue.UriSuffix,
                typeof(IPCBaseMessagesQueue));
            _worker = new Thread(ListenQueue);
            _worker.Start();
        }
コード例 #8
0
        public BaseIPCReceaver()
        {
            _ownGUID           = new IPCReceaverGUID();
            _currentWaitHandle = new EventWaitHandle(false, EventResetMode.AutoReset,
                                                     _ownGUID.Value);
            _currentQueue = DoCreateQueue();

            // do not use security
            // ensure that IPC server is alive
            if (!ChannelServices.RegisteredChannels.Any(i => i.ChannelName == _ownGUID.Value))
            {
                channel = new IpcServerChannel(_ownGUID.Value, _ownGUID.Value);
                if (!ChannelServices.RegisteredChannels.Any(i => i == channel))
                {
                    ChannelServices.RegisterChannel(channel, false);
                }
            }

            RemotingServices.Marshal(_currentQueue,
                                     _currentQueue.UriSuffix,
                                     typeof(IPCBaseMessagesQueue));
            _worker = new Thread(ListenQueue);
            _worker.Start();
        }
コード例 #9
0
 public TestAsyncComplexMessage(IIPCGUID senderID, ComplexSharedClass additionalInfo)
     : base(senderID)
 {
     _additionalnfo = additionalInfo;
 }
コード例 #10
0
 public IPCBaseAsyncMessage(IIPCGUID senderID)
 {
     _senderID = senderID;
     _isValid = DoValidateMessage();
 }
コード例 #11
0
 public TestAsyncComplexMessage(IIPCGUID senderID, ComplexSharedClass additionalInfo)
     : base(senderID)
 {
     _additionalnfo = additionalInfo;
 }
コード例 #12
0
 public IPCBaseSyncMessage(IIPCGUID senderID, 
     int timeout) {
     _senderID = senderID;
     _timeout = timeout;
 }
コード例 #13
0
 public IPCUri(IIPCGUID sharedObjGuid, string suffix)
 {
     _sharedObjGuid = sharedObjGuid;
     _suffix        = suffix;
 }
コード例 #14
0
ファイル: IPCUri.cs プロジェクト: jjchoi/SimpleIPCCommSystem
 public IPCUri(IIPCGUID sharedObjGuid, IIPCSharedObject suffix)
 {
     _sharedObjGuid = sharedObjGuid;
     _suffix = suffix.UriSuffix;
 }
コード例 #15
0
 public TestSyncMessage(IIPCGUID senderID,
                        int timeout = IPCBaseSyncMessage.InfiniteTimeout)
     : base(senderID, timeout)
 {
 }
コード例 #16
0
 public TestAsyncMessage(IIPCGUID senderID)
     : base(senderID)
 {
 }
コード例 #17
0
 public IPCBaseAsyncMessage(IIPCGUID senderID)
 {
     _senderID = senderID;
     _isValid  = DoValidateMessage();
 }
コード例 #18
0
ファイル: IPCGUID.cs プロジェクト: jjchoi/SimpleIPCCommSystem
 public bool Equals(IIPCGUID other)
 {
     return String.Equals(other.Value, Value);
 }
コード例 #19
0
ファイル: IPCUri.cs プロジェクト: jjchoi/SimpleIPCCommSystem
 public IPCUri(IIPCGUID sharedObjGuid, string suffix)
 {
     _sharedObjGuid = sharedObjGuid;
     _suffix = suffix;
 }
コード例 #20
0
 public TestSyncMessage(IIPCGUID senderID,
     int timeout = IPCBaseSyncMessage.InfiniteTimeout)
     : base(senderID, timeout)
 {
 }
コード例 #21
0
 public IPCBaseSyncMessage(IIPCGUID senderID, 
     int timeout)
 {
     _senderID = senderID;
     _timeout = timeout;
 }
コード例 #22
0
 public IPCUri(IIPCGUID sharedObjGuid, IIPCSharedObject suffix)
 {
     _sharedObjGuid = sharedObjGuid;
     _suffix        = suffix.UriSuffix;
 }
コード例 #23
0
 public TestAsyncMessage(IIPCGUID senderID) : base(senderID)
 {
 }
コード例 #24
0
 public TestInvalidMessage(IIPCGUID senderID)
     : base(senderID)
 {
 }
コード例 #25
0
 public bool Equals(IIPCGUID other)
 {
     return(String.Equals(other.Value, Value));
 }
コード例 #26
0
 public TestInvalidMessage(IIPCGUID senderID) : base(senderID)
 {
 }