UDP Sockets

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
onionman
Knows some wx things
Knows some wx things
Posts: 34
Joined: Wed May 20, 2009 7:03 pm

UDP Sockets

Post by onionman »

Hey...

I've tried to do some research, but all the wx information I could find on the subject is pretty dated.

I've recently released a game built on wxWidgets, and have made it multiplayer.
http://www.indiedb.com/games/helena-the-3rd

The game uses the standard TCP sockets, but I was wondering if I could send data over with UDP. All the googling I could find tells me I need to make a
wxDatagramSocket. Is this still the preferred method for opening UDP sockets in wxWidgets, or is there something more current?
JimFairway
wxWorld Domination!
wxWorld Domination!
Posts: 1059
Joined: Sun Dec 30, 2007 6:40 pm
Location: Canada

Re: UDP Sockets

Post by JimFairway »

Hi,

I've used wxDatagramSocket without issue.

Jim
OS: Vista SP1, wxWidgets 2.8.7.
onionman
Knows some wx things
Knows some wx things
Posts: 34
Joined: Wed May 20, 2009 7:03 pm

Re: UDP Sockets

Post by onionman »

Does anyone have any complete examples of sending and receiving UDP sockets?

All the examples I can find online only show the sending with a datagram socket, and I'm a little confused how this all fits together. It seems I can't use wxDatagram sockets the same way I've been using servers and clients.

Another question, to anyone's knowledge, would it be possible to combine UDP sockets and TCP sockets in the same wx application?
Post Reply