"Of SDL_Net & UDP"

Hi

I have been looking at using SDL_Net to write a simple cross platform Game
Server (as a test project). I had planned to use UDP to provide a fast
mechanism for sending a receiving game data. However, It seems that SDL_Net
is limited to only 32 Channels per socket and only 4 address can be bound to
each channel.

The problem I have is what if you need to send/recieve data from say 100
clients on Port 80 (or some other port that a firewall would allow through).
There are not enough channels/addresses to handle all the clients, as we
would need to bind each client address to a port… So how would you do it?

Does anyone have any thoughts on this. Feel free to “educate” me on the usage
of UDP as I am new to this :slight_smile:

Dean–

http://www.cerebral-bicycle.co.uk
http://www.delphigamer.com

Hi

I have been looking at using SDL_Net to write a simple cross platform Game
Server (as a test project). I had planned to use UDP to provide a fast
mechanism for sending a receiving game data. However, It seems that SDL_Net
is limited to only 32 Channels per socket and only 4 address can be bound to
each channel.

The problem I have is what if you need to send/recieve data from say 100
clients on Port 80 (or some other port that a firewall would allow through).
There are not enough channels/addresses to handle all the clients, as we
would need to bind each client address to a port… So how would you do it?

You are very confused. :slight_smile: Been there, and I have a lot of sympathy for
you. These limits don’t really affect the number of UDP/IP clients you
can have. The bind udp bind functions in SDL_net can be ignored, you can
keep track of the information your self. Also, you can go into the code
and change it if you want to.

Does anyone have any thoughts on this. Feel free to “educate” me on the usage
of UDP as I am new to this :slight_smile:

You might get some insight from reading
http://gameprogrammer.com/net2/net2-0.html. It is a layer on top of
SDL_net that makes the networking code much easier to write. If you
choose to use them, the NET2 package provides sets for keeping track of
things, but in C++ even I would not use my implementation of sets :-0

	Bob PendletonOn Thu, 2003-10-16 at 16:59, Dean Ellis wrote:

Dean

±----------------------------------+

Thanks Bob

I had a good read of the SDL_Net Documentation last night and found that the
bind and unbind functions are not needed. I now have a working test
application :-).

I’ll have a look at Net2, but I use the JEDI-SDL library and Delpi/Kylix to
develop with so if it’s not a DLL then we probably won’t be able to use it.
But the source code might give me a few tips on handling threads :slight_smile:

Thanks again

DeanOn Thursday 16 October 2003 22:42, Bob Pendleton wrote:

On Thu, 2003-10-16 at 16:59, Dean Ellis wrote:

Hi

I have been looking at using SDL_Net to write a simple cross platform
Game Server (as a test project). I had planned to use UDP to provide a
fast mechanism for sending a receiving game data. However, It seems that
SDL_Net is limited to only 32 Channels per socket and only 4 address can
be bound to each channel.

The problem I have is what if you need to send/recieve data from say 100
clients on Port 80 (or some other port that a firewall would allow
through). There are not enough channels/addresses to handle all the
clients, as we would need to bind each client address to a port… So how
would you do it?

You are very confused. :slight_smile: Been there, and I have a lot of sympathy for
you. These limits don’t really affect the number of UDP/IP clients you
can have. The bind udp bind functions in SDL_net can be ignored, you can
keep track of the information your self. Also, you can go into the code
and change it if you want to.

Does anyone have any thoughts on this. Feel free to “educate” me on the
usage of UDP as I am new to this :slight_smile:

You might get some insight from reading
http://gameprogrammer.com/net2/net2-0.html. It is a layer on top of
SDL_net that makes the networking code much easier to write. If you
choose to use them, the NET2 package provides sets for keeping track of
things, but in C++ even I would not use my implementation of sets :-0

  Bob Pendleton

Dean

http://www.cerebral-bicycle.co.uk
http://www.delphigamer.com

Thanks Bob

I had a good read of the SDL_Net Documentation last night and found that the
bind and unbind functions are not needed. I now have a working test
application :-).

Great! I hope I helped.

I’ll have a look at Net2, but I use the JEDI-SDL library and Delpi/Kylix to
develop with so if it’s not a DLL then we probably won’t be able to use it.
But the source code might give me a few tips on handling threads :slight_smile:

I no longer have a windows development environment so I can’t build a
.dll for you. But, I know a number of other people have used it for
Windows development.

	Bob PendletonOn Fri, 2003-10-17 at 15:36, Dean Ellis wrote:

Thanks again

Dean

On Thursday 16 October 2003 22:42, Bob Pendleton wrote:

On Thu, 2003-10-16 at 16:59, Dean Ellis wrote:

Hi

I have been looking at using SDL_Net to write a simple cross platform
Game Server (as a test project). I had planned to use UDP to provide a
fast mechanism for sending a receiving game data. However, It seems that
SDL_Net is limited to only 32 Channels per socket and only 4 address can
be bound to each channel.

The problem I have is what if you need to send/recieve data from say 100
clients on Port 80 (or some other port that a firewall would allow
through). There are not enough channels/addresses to handle all the
clients, as we would need to bind each client address to a port… So how
would you do it?

You are very confused. :slight_smile: Been there, and I have a lot of sympathy for
you. These limits don’t really affect the number of UDP/IP clients you
can have. The bind udp bind functions in SDL_net can be ignored, you can
keep track of the information your self. Also, you can go into the code
and change it if you want to.

Does anyone have any thoughts on this. Feel free to “educate” me on the
usage of UDP as I am new to this :slight_smile:

You might get some insight from reading
http://gameprogrammer.com/net2/net2-0.html. It is a layer on top of
SDL_net that makes the networking code much easier to write. If you
choose to use them, the NET2 package provides sets for keeping track of
things, but in C++ even I would not use my implementation of sets :-0

  Bob Pendleton

Dean

±----------------------------------+