Jump to content

UDP client on DS + server on Linux/Windows?


ttursas

Recommended Posts

Has anyone got sources for such combination? Just a simple UDP client that runs in DS, and a server that works on

Linux or Windows... If you have sources for such a software (I don't care what it does as long as it really works, and

sends packets from the client to the server, and possibly even back), please let me know, and email me the sources! :(

I need to know if my local Wifi-network is plain broken... Or is my DevKitARM fuxored? Or is it just that I suck at coding. :unsure:

Link to comment
Share on other sites

Are you doing this just for testing purposes, or to create a full program? For a very simple test UDP listening server, you could use netcat.

 

For example:

 

nc -lu -p 123

 

This will make netcat listen for incoming UDP data on port 123, and print it to the terminal.

 

To send data to this server, you could use the UDP test mode of the wifi_lib_test program.

Edited by MS3FGX
Link to comment
Share on other sites

Are you doing this just for testing purposes, or to create a full program? For a very simple test UDP listening server, you could use netcat.

 

For example:

 

nc -lu -p 123

 

This will make netcat listen for incoming UDP data on port 123, and print it to the terminal.

 

To send data to this server, you could use the UDP test mode of the wifi_lib_test program.

 

I'd use it for testing. But I've added some UDP code to that wifilib_example, and can for some reason send only 12 UDP packets

after which dswifilib just starts to return -1 from sendto()... A real working client-server combination would be nice, so I could

really be 100% sure that it really works at least somewhere. If not at my home, then there would be something wrong in my local

network, I guess.

Link to comment
Share on other sites

For a working UDP server/client software, you could always try tetattds. *shameless advertising* =)

Download it here.

 

The server compiles on either linux or windows.

 

It shouldn't be all that hard to pull out just the network code if you want to play around with it.

We're looking at converting the network code from the game into a separate lib instead of the way it is now,

but that'll probably take a while yet.

 

 

<random thoughts>

As for only being able to send 12 packets, could it have something to do with the number of memblocks in dswifi being set to 12? I haven't looked into it that much, but it sounds like some kind of memory allocation/deallocation problem could be the cause of it. Dswifi might fail to send if it's unable to get hold of a free memblock.

</random thoughts>

Edited by Ted
Link to comment
Share on other sites

Unless I'm missing something, this is fairly simple. My Win2DS code is posted in its forum, the DS is a client and the server runs on Windows, but the code is fairly abstrated, although in C++. Shouldn't be hard to get the basic parts of the server code, since it uses berkley sockets (although there is some WinSock crap in there), which are standard between platforms.

Link to comment
Share on other sites

For a working UDP server/client software, you could always try tetattds. *shameless advertising* =)

Download it here.

 

Thanks! I'll check it out tomorrow... :(

 

<random thoughts>

As for only being able to send 12 packets, could it have something to do with the number of memblocks in dswifi being set to 12? I haven't looked into it that much, but it sounds like some kind of memory allocation/deallocation problem could be the cause of it. Dswifi might fail to send if it's unable to get hold of a free memblock.

</random thoughts>

 

I can see from Stephen's Weblog that he's found some memory allocation related bugs. Could be that if I waited for 0.3b my wifi code might start working... Anyway, meanwhile I'll check out tetattds :) and do more testing.

Link to comment
Share on other sites

For a working UDP server/client software, you could always try tetattds. *shameless advertising* =)

Download it here.

 

The server compiles on either linux or windows.

</random thoughts>

 

I just tested TetattDS (a nice game, BTW! :) ), and dswifilib 0.3b, but it didn't work. I mean, the game couldn't connect to the server.

Everything compiled just fine under Linux...

 

Damn. I hoped that 0.3b would solve my problems, but so far 0.3b has worked worse than 0.3a. With 0.3a I could send those

12 UDP packets using the supplied wifi_example1 as my basis. With 0.3b I managed to send one, but that would freeze

my own application. Ugh... :(

 

You wouldn't happen to have a TetattDS-server running somewhere?

Link to comment
Share on other sites

For a working UDP server/client software, you could always try tetattds. *shameless advertising* =)

Download it here.

 

The server compiles on either linux or windows.

Hehee, I got it working! Plugged both my DS (via Wifi) and my PC to D-Link DI-524 (my wireless router),

and addressed the server on my PC using its IP. Both are now under 192.168.0.*... So TetattDS has now

network play with 0.3b in my local configuration. When I had my PC outside DI-524, but connected to my

ADSL model (and DI-524 is connected to my ADSL modem as well), it didn't work. 0.3a didn't work no

matter how I had configured the cables...

 

Also wifi_example1 works with my UDP code, but unfortunately my own game freezes when it has sent

its first UDP packet... Have to investigate it more, but now this is really progressing.

 

Thanks for TetattDS, also, I got a bit addicted to it while testing dswifilib... :)

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...