Skip to main content
GameDev.net gamedev.net
🔒 Locked

UDP testing

Started by osh Nov 30, 2003 at 3:13 AM 4 replies 700+ views
Original Post
osh
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
osh
osh
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?
iliak
iliak
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 ]
osh
osh
Because I am absolute newbie in this topic, can u send me source code example? plsssss!
osh
osh
Nvm, I did it! But thanks for your help!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.