× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




On 06/02/2006, at 12:17 PM, Dave Johnson wrote:

I guess I'm not understanding why you keep mentioning the IP address.

Only that I don't believe you are connecting to the system you think you are connecting to. For example, your network may be set up to use SOCKS or a proxy in which case you would really be connecting to the proxy and the proxy would forward the request and response. For SOCKS you would normally have to configure the client to use the SOCKS server.

That's why I suggested getpeername() because it may shed some light on where the system thinks you are connected.

What difference would that make?

Maybe it's not the same address on each pass due a coding defect. There is at least one such in your code.

When I have the socket server running on the PC, the program works. If I stop the socket server on the PC two seconds later and then rerun the program again, it appears to work but doesn't really. I can't imagine how the IP address would change on the same interactive session in the space of 20 seconds unless I'm totally not understanding this process.

inet_addr() expects a null-terminated string to be passed in. You are passing a character variable with no null-terminator that I could see. If storage happened to have a null on the first pass and didn't on the second pass this would explain why the address could change.

You don't check that inet_addr() completed successfully. You just use whatever it returns which could be -1. This would be interpreted as an IP address of 255.255.255.255

Also RtvNetAds is returning 16 bytes from position 877. Why? It should be returning 15 bytes from position 878 (equal to offset 877).

Try running the expected-failure run immediately after signing on to a fresh session. Does this behave the same way?

It would be odd but maybe you're getting some latent connexion due to dodgy TCP stack. Maybe the PC socket server hasn't properly closed things?

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists

   http://www.flybynight.com.au/
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175                                   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.