File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes UDP packet formatting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "UDP packet formatting" Watch "UDP packet formatting" New topic

UDP packet formatting

Amit Sharma

Joined: Nov 04, 2002
Posts: 1
I am have to write a class that will allow connection to a game server. I have a description of the format of the UDP packets that need to be sent and recieved to make the connection, however, I do not know how to format the UDP datagram packets.
I searched online for quite some time, but couldn't figure out how to do this task. Any help anyone can provide would really help. Thanks in advance.
What I have to do is:
Remote App sends a UDP packet to the server on the server's port (e.g.,
The packet should start with 4 consecutive bytes of 255 (32-bit integer -1) and the string:
"challenge rcon\n".
The server will respond to the requesting system on the purported remote IP address and port with four 255's and:
"challenge rcon number\n" where number is an unsigned int32 number.
To issue the actual rcon, the remote App then responds with a UDP packet containing 4 255s and:
"rcon number \"password\" rconcommands" where password is the rcon_password ( should be enclosed in quotes as noted so that multiple word passwords will continue to work ), number is the unsigned int32 number received from the server and rconcommands is the actual rcon command string.
I agree. Here's the link:
subject: UDP packet formatting
It's not a secret anymore!