Click here to Skip to main content
15,899,632 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do a client send a message to another clients, after the client received the message, run a method.
The clients are depended on WPF.
Thanks~
Posted
Comments
Sergey Alexandrovich Kryukov 14-Jul-11 2:19am    
Clients of what?
--SA
eric881027 14-Jul-11 2:43am    
I'm sorry, I didn't make it clear, I mean messages for the underlying transport.
BobJanova 14-Jul-11 5:55am    
Still not clear to me what 'client' means in this context. Are 'clients' connected to a server? Are you using a web service, normal sockets, carrier pigeon ... what is the message in question being sent over?
Mark Salsbery 14-Jul-11 18:46pm    
You need to choose some sort of transport. Assuming internet communication, that will be TCP/IP or a protocol on top of TCP/IP like HTTP. Client-to-client (or peer-to-peer which is probably what you mean) means one or all peers need to be able to listen for connections, effectively making every "client" a "server" as well. That brings in administration issues - many computers aren't set up to allow incoming connections by default, and many network admins won't allow it. Do you really want your users to have to configure firewalls and port forwarding? This needs to be taken into consideration.

Since most machines are configured to allow outbound connections (like accessing the web)I personally use a server (usually using HTTP protocol), which acts as a relay server. Clients don't directly connect peer to peer, but instead only connect to the server. The server relays messages (or media streams) on to the recipient peer(s). This way the only administration issues are on the server.

1 solution

You can chose one of the different levels of networking I overview in my past solutions:
how i can send byte[] to other pc[^],
Communication b/w two Windows applications on LAN.[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900