Home > Net >  C # how to achieve more machine using UDP communication?
C # how to achieve more machine using UDP communication?

Time:10-12

Turn your bosses, c # code control two or more computer communication how to implement? A host, from any machine (2 sets)

CodePudding user response:

Different computers, even the same local area network (LAN) can also be broadcast

CodePudding user response:

Yes, LAN broadcasting,

CodePudding user response:

You first need to define your communication of several machines? What is the format of the communication? Such as JSON (UDP cannot exceed 65535 bytes), or 2 hexadecimal,
Such as
A - B "{" source" : 'A', CMD: 'open the web page, url: "http://www.sohu.com"}
B - & gt; A {" source ": 'B', CMD: 'I've turned on the web page, url:' http://www.sohu.com ', HTML content: 'XXXX cannot exceed 60 KB oh'}

Note that A to B when Socket to like the EndPoint to write B IP and port,
B to A similarly

CodePudding user response:

UdpClient object,

CodePudding user response:

UDP broadcast can fulfill your requirements

CodePudding user response:

TCP, UDP, WCF, Rometing can be implemented

CodePudding user response:

UDP does not need to connect a handshake can send and receive messages, but also easy to lose packets, your thoughts can be on the same network segment XXX. XXX. XXX. 255 is sending a message broadcast messages, all the machines that are within the network segment can message is received,
  •  Tags:  
  • C #
  • Related