UDP testing

Started by
4 comments, last by osh 20 years, 4 months ago
I''m using SDLNet and I want to test net comunication on one computer, but I cant create socket on same port twice(one for every client). So how can I test my code? Btw is there any speed difference between Winsock and SDLNet? Thx
Advertisement
quote:Original post by osh
I''m using SDLNet and I want to test net comunication on one computer, but I cant create socket on same port twice(one for every client). So how can I test my code?
Btw is there any speed difference between Winsock and SDLNet?

Thx


I don''t know about SDLNet, but I do know (at least with Winsock) that you normally have a port that listens for a new connection then you let Winsock assign the port to the new connection.

In SDLNet I must open socket at first. Then I can call functions like Send and receive with this socket, BUT it don''t let me open the same socket, so I can''t send data in one prog and receive them in second prog on the same socket. So is my idea wrong? Is there any way?
On the server side, open a socket on a port (ie 10987) and *listen* on it. With your client, *connect* to the server port and let SDLNet choose a port for your client.

Here''s an example :

Server listen on port 10987
Client try to connect on 127.0.0.1:10987

That''s all man

- Iliak -
- Iliak -
[ ArcEngine: An open source .Net gaming framework ]
[ Dungeon Eye: An open source remake of Eye of the Beholder II ]
Because I am absolute newbie in this topic, can u send me source code example? plsssss!
Nvm, I did it! But thanks for your help!

This topic is closed to new replies.

Advertisement