Archived

This topic is now archived and is closed to further replies.

UDP testing

This topic is 5128 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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 -

Share this post


Link to post
Share on other sites