I have a game server (WoW). I want my players to download my custom patches to the game. I've done a program that checks for update/downloading things. I want my program to send a packet to my game server if player have all my patches. I dont need any response from the server, it will handle it, but its another story.
So I want to know, how to send a packet to a server.
Thank you!
UDP sockets can be connected or unconnected - in the first case send should be used and in the second sendto . This does not affect the protocol used, i.e. it still is unreliable UDP. It only affects where the destination is taken from: from the socket or given as argument.
To use UDP, you must use the %New()Opens in a new tab method to create a UDP socket object. This object instance is then used to send, receive, and reply to packet transmissions. Both the port number and the host address are optional.
UDP is a connection-less protocol that, unlike TCP, does not require any handshaking prior to sending or receiving data, which simplifies its implementation.
No, you can't have a TCP server communicating with UDP clients.
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); IPAddress serverAddr = IPAddress.Parse("192.168.2.255"); IPEndPoint endPoint = new IPEndPoint(serverAddr, 11000); string text = "Hello"; byte[] send_buffer = Encoding.ASCII.GetBytes(text ); sock.SendTo(send_buffer , endPoint);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With