duplex

Async socket - Duplex communication with permanent sockets in c#

三世轮回 提交于 2019-12-11 05:38:42
问题 I'm trying to do asynchronous socket communication, and want the server to keep a list of all connected sockets, so he can broadcast messages to them. First I took the examples from msdn Asynchronous Socket Server and altered them a little so they don't close the sockets. (just removed the .shutdown and .Close commands) But doing so, seems to cause the client to hang in the "receiving part". Here are the changes I made to the msdn examples: Client: only changed ReceiveCallback() so it stays

WCF & ASP.NET: Duplex Support using AJAX

南楼画角 提交于 2019-12-11 01:08:53
问题 I know that WSDualHttpBinding, NetTcpBinding, and NetPeerTcpBinding bindings all support duplex/callback service operations. I can't find anywhere on the internet anyone even asking if duplex is somehow supported for ajax calls. Maybe the reason for my inability to find anything on this is because I am completely misunderstanding some key WCF concept that makes the question the dumbest question there is... I know that the webHttpBinding binding along with <enableWebScript/> gneerates the js

WCF Duplex Communications in a clustered environment

老子叫甜甜 提交于 2019-12-10 10:06:46
问题 So I was looking at the sample examples people have created for Duplex Communications namely when hosted by IIS and connected to via Silverlight. There are plenty of examples of this out there (this MSDN article is great), but all use the same paradigm: User A connects to server A, it puts him in an in-memory list to receive future updates. User B connects to server A, it notifies all users in list that someone "logged in". ... but what happens when User C connects to server C, the in-memory

Why is a TimeoutException not faulting my channel?

荒凉一梦 提交于 2019-12-10 09:48:18
问题 I have a duplex WCF service and client running on the same machine. The client is configured to have 15 second timeouts: <binding name="NetTcpBinding_IServiceIPC" closeTimeout="00:00:15" openTimeout="00:00:15" receiveTimeout="00:00:15" sendTimeout="00:00:15" /> The client is handling faults like this: client.InnerChannel.Faulted += FaultHandler; client.InnerDuplexChannel.Faulted += FaultHandler; client.ChannelFactory.Faulted += FaultHandler; If I kill my Service process, the client correctly

WCF duplex TCP communication error

限于喜欢 提交于 2019-12-08 03:31:10
问题 I have a sample service to test WCF net.tcp communication. It is very simple service and all it does is subscribing a client to the service and then calls callbackchannel to notify all connected clients about broadcasted message. The service is hosted inside IIS 7.5. Here is service code and test client to test it. [ServiceContract(CallbackContract = typeof(ISampleServiceCallBack), SessionMode = SessionMode.Required)] public interface ISampleCuratioService { [OperationContract(IsOneWay = true

WIA 2.0 Duplex property

放肆的年华 提交于 2019-12-07 08:10:53
问题 I am developing an aplication with C# to use the WIA 2.0 library. At the moment I could use most of the features, such as ADF (auto document feeder), filters and more. Now, I need to use the duplexer of my scanner (fujitsu). I'm trying to set the WIA_DPS_DOCUMENT_HANDLING_SELECT scanner property to the DUPLEX value. See the code below: try { bool hasMorePages = false; //determine if there are any more pages waiting Property documentHandlingSelect = null; Property documentHandlingStatus = null

duplex operation between two processes using named pipes in c#

不想你离开。 提交于 2019-12-07 03:50:40
问题 I am trying to use named pipes to communicate between a server and a client process on the same machine. server sends a message to client, client does something with it and returns a result, and server is supposed to get the result. here is the code for server: using System; using System.IO; using System.IO.Pipes; class PipeServer { static void Main() { using (NamedPipeServerStream pipeServer = new NamedPipeServerStream("testpipe", PipeDirection.InOut)) { Console.WriteLine(

Identifying clients in a WCF service

独自空忆成欢 提交于 2019-12-07 02:28:43
问题 I have a working duplex WCF service with WSDualHttpBinding . My problem is figuring out a way to store the callback channel with a unique id. The service is intended to be long-running. Can I simply grab the OperationContext.Current.GetCallbackChannel() return value when a "Subscribe" method is called and store it in a list or dictionary? Is it guaranteed to be valid until the connection is alive? 回答1: The easiest way would be to have the client submit a key value in the Subscribe method of

How to: Responsive available Wcf duplex communication

爱⌒轻易说出口 提交于 2019-12-06 13:14:43
I'm working on an application that uses WCF to communicate between server and clients Server has changing number of services, along with one master service that clients can query for information about other services, and then subscribe to those they want using information from master service. Master service sends notifications to subscribed clients, when sub-services change (added, removed, etc) Also sub-services send notifications every few seconds. This sounds like a great opportunity for using WCFs Callback channels, however, they require you to use session. Also when sending notifications

WCF duplex channel gets closed when using callbacks

℡╲_俬逩灬. 提交于 2019-12-06 12:45:01
问题 My WCF service uses netTcpBinding, and has a callback object. I need to service multiple concurrent clients, and mantain sessions, so the service is decorated with [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple] To avoid thread deadlocks, the callback class is decorated with [CallbackBehavior(UseSynchronizationContext=false)] and I use SynchronizationContext to execute the method in the UI thread. The problem is that sometimes