🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Winsoc and ICS

Started by
0 comments, last by Ironside 22 years, 4 months ago
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 192.168.0.1 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
Advertisement
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

This topic is closed to new replies.

Advertisement