Advertisement

Sent packets returned? (WS2.0)

Started by December 11, 2002 02:00 PM
3 comments, last by Daywalker313 22 years, 2 months ago
I''ve got a strange problem with my networking wrapper. It works fine as long as I either run it from 2 different computers or split the client/server part in 2 seperate apps. But I wanted my game to use the singleplayer mode like qIII does: A server is started and the local player connects to it. So I start the server as independent thread and let the client connect to it (127.0.0.1). But if I send packets (TCP), they are returned to the socket they came from :S. Do I have to add special flags to the socket to avoid that? Visit: Lejendz
Special flags? nope

All you need is to use two different port numbers over two different sockets.

I personally did this over UDP, and it worked fine....... By the way, since you want to make an FPS, you should consider UDP as well.

Looking for a serious game project?
www.xgameproject.com
Advertisement
Thx for your reply, I''ll try it out :D.
The networking wrapper was designed for a MMO game and as most of the packets are important, we decided to use TCP. The game I want the localhost for is a simple but cool 3d version of pong.

Visit: Lejendz

You must have something wrong in your observations to observe that a tcp client has sent packets to itself.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
ype, it works now :D. The client and server were sharing the sockets and the server didn''t recognize if the socket was already in use, so he connected the same socket with itself.

Visit: Lejendz

This topic is closed to new replies.

Advertisement