Jump to content
  • Advertisement


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


Winsoc and ICS

This topic is 6057 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 need to know if any of you out there have solved this problem. Here is the senario, i'm using a UDP socket implementaiton. I have two applications an EchoServer who just echos back anything that's sent to it using the infromation provided by recvfrom(). I have Internet Connection Services (ICS) running on my main computer. It assigns an address of to the main computers netowrk adapter and that becomes the gateway for other hosts on my netwrok which recieve ip addresses in the 192.168.0.XXX subnet automatically. My problem is this, i run my server on my ICS machine, and i run my client on one of the host machines on my network. When i send a packet to my server from one of the hosts it actually recieves two packets which identify themselves as being from my machine, unfortunatly none of them are from the port that i sent my packet from on my host machine. They appear to be two other random ports, my server then attempts to echo back these packets to these ports and they ovbiously never arrive at my client. I think this has something to do with network address translation, i dont want to hard code the reply-to port into my packet because then i can't support support firewalls. any insight would be appreciated. Edited by - ironside on February 17, 2002 2:44:20 AM

Share this post

Link to post
Share on other sites
So i found the solution to my problem. And it''s somewhat interesting. I used netmon to verify that only one packet was being sent. Sure enough i saw one packet comming in and two comming out, the question was, now why was my server thinking there were two incomming packets and then replying to them?
I looked at the two outgoing packets and looked at their destination ports, sure enough one was my default port 2002 or 07D2 in hex. But what''s this the wacko port number i had no idea where was comming from it''s hex D207.
Networkbyte order strikes again. The fix was to use ntohs() to convert the port number provied by recvfrom() to host byte order before using it in sendto(). When i did that the second mysterious packet dissapered, go figure

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!