Jump to content

Simple UDP Server Example


cybereality

Recommended Posts

I put together this simple little udp example for testing the ds wifi. I'm sure this has been done before, but I figured a simple example would be helpful to some. The code is heavily based on the example code from the WinSock2.0 book. It compiles on cygwin/g++ and some others (but I have not tested). You'll also need the winsock dll to do the dirty work. This is not a DS app. The file contains a server app and a client app, both for the pc. With this, you can test any UDP programs using a simple command line chat program. It is single threaded, so you can only chat back and forth (like ping-pong). I have tested it with the udp-example sgstair released and also the stripped down version by sintax. It should work with any app the uses this protocol. The best part is that you can test the server-side functions in another command window instead of using the ds to test.

 

I started this project to familiarize myself with udp with the hopes of making a wifi enabled app for the ds. Unfortunately, my professional projects have eaten all my time and I had to put the project on hold. Now that it seems like the new update will have TCP/IP and other functionality, I dont know if I will bother continuing the project. So here is the source for anyone that needs it. I have also included the executables if you just wanted to test your udp app with a command line program. Using this code as a foundation it would be possible to leverage pc libraries to do the dirty work and use the ds as a simple terminal to recieve the information. I hope someone will benefit.

 

UDP Server/Client Example (binary & source)

 

// cybereality

Link to comment
Share on other sites

Thanks sypherce. I meant to mention that it needed cygwin1.dll. I just totally forgot. If you need to find it you can just put 'cygwin1.dll' into google and theres a bunch of sites that have it. Then copy and paste into the windows/system32 folder.

Edited by cybereality
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...