Last post Nov 07, 2012 04:08 AM by Haixia Xie - MSFT
Oct 30, 2012 04:34 PM|mou_inn|LINK
i am wcf beginner and i saw many people develop chat apps with wcf. i never develop any chat apps before.my question is when three client connect to wcf service like user A,B & C then how user A can send message particularly to B not C. message send by IP
address or any other mechanism like long polling or p2p system. this things is not clear to me that if i ever try to develop any chat apps with wcf then how user A can send message to user B not other.
please do not give any url link for wcf chat because most of the apps are heavily coded. if possible then please tell me the all kind of mechanism people use to send message from one to another specific end. thanks
Oct 30, 2012 06:34 PM|ozkary|LINK
If you just need to do a p2p connection then you can use net.p2p protocol with netPeerTcpBinding. This protocol can be used without having a server service.
try this chat (made with SignalR): http://jabbr.net/
hope it helps.
Oct 31, 2012 02:43 AM|mou_inn|LINK
i think u mis understand my question. i just need to know when wcf chat client A send message for client B to wcf service then how wcf service can pass the data to client B not C. i need to know how wcf service pass data to specific client or make occur
a callback at right client end.
Nov 01, 2012 11:12 AM|ozkary|LINK
The clients connect directly to the service. This means that an open connection exists between each client and the server but not client 2 client. This is how you can see a list of people in the chat room. When clientA sends a message to clientB, the message
is received and routed by the service. The service looks for the open connection (clientB) and sends the message to the target (clientB). The information of what client you want to chat to can be as simple as SendMessage(string user, string message). User
would be clientB.
When you are using a WCF chat service, your service will need to required an open connection (config/binding) from the client. The service will need to have the logic to know all the connected clients and route the message accordingly. This is basically
already done if you use a framework like Signalr.
Hope I understood your question this time.
Nov 05, 2012 02:00 AM|mou_inn|LINK
thanks for your answer. i just need to know how service route any data to client. when client A send message to service for client B then how service push that message to client B. can u give me very small sample code generally which is used by service to
push message to right client. people use dupex message patter here in this situation? or client use long polling technique to hit server again & again to look for any data is there or not for that client. thanks
Nov 07, 2012 04:08 AM|Haixia Xie - MSFT|LINK
Please take a look at my response in this thread to check if it can help you.