• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Quickest way to implement UDP Client/Server

**Please don't provide any direct code as this is HW. Hints/Advice is welcome, but nothing else**

I have a Network Architecture Programming project due on Sunday night and, given my extreme case of Senioritis 😉, I've waited until right now to start.

We can write the client and server in any language, but I'm actually torn between POSIX C++ and Java.

We are pretending that the data transfer is reliable and that it needs to simply transfer a file of up to 1GB in size.

The next assignment will be to multi-thread the code, so thread safe functions and the ease of multi-threading is preferred.

My question is, which language would this be easiest and fastest to do this in? I'm thinking Java given its Multi-threaded support and high level sockets() API.

I've made a telnet/curl server in C that supported HTTP/1.1 (Concurrent threads using fork(), and persistent connections). Should this be similar to that for the most part? I don't see this project taking very long at all (at most a few hours - would I be vastly oversimplifying something?)

Thanks,
-Kevin

Edit: Heck thinking about this, it should only take about 50 lines and a couple minutes to get it working (In Java) unless I'm way way off base.
 
Last edited:
If you are in school - your time factor is off by at least an order of magnitude. Something will not work and you will not have your error handling logic properly implimented
 
I actually think I completely finished it in Java.

I had trouble testing it as I had a bug. Java's errors aren't as each to trace in gdb or valgrind as C/C++. Turns out I misunderstood what the offset was in the some of the I/O - stupid error really.

The MTU is set for 500 bytes. I've successfully transmitted multiple MB files from point A to point B and calculated the time and transfer rate.

I sent an E-Mail to my instructor to make sure that I produced what he wants (I may not have layered it enough to create a robust protocol - so I may need to add a couple things).

-Kevin
 
Sounds like you figured it out (and I would've recommended Java as you chose).

I just wanted to mention that fork() produces processes, not threads.
 
Sounds like you figured it out (and I would've recommended Java as you chose).

I just wanted to mention that fork() produces processes, not threads.

Whoops, my mistake there 🙂

Working in Java was a lot faster/easier. I don't have to worry about calling bind() and fork() appropriately - It's all abstracted away. I created a C based server that is ready to go as well, I just would need to do some slight modifications as it is an HTTP server right now.
 
Back
Top