Title: RtcHttpServer PeerAddr returns 0.0.0.0 Post by: SevenOut on May 24, 2014, 03:29:37 AM I have an old app that was using the v2.7 rtc sdk under D2007. I've ported it to XE6 and v6.33 rtc sdk. So far everything is working fine except that the PeerAddr is now returning 0.0.0.0 when it used to return the IP of the connected client.
I can run the old app on the same computer and see the connected IP but running the new app I get 0.0.0.0. I've looked everywhere and can;t figure out why. Any ideas? - Scott Title: Re: RtcHttpServer PeerAddr returns 0.0.0.0 Post by: SevenOut on May 24, 2014, 03:35:43 AM Just in case you were wondering... I am not using a proxy. This is simply 2 computers on a local network.
Title: Re: RtcHttpServer PeerAddr returns 0.0.0.0 Post by: D.Tkalcec (RTC) on May 24, 2014, 07:23:07 AM I've ran a short test with a new Project in Delphi XE6, mapping all events and logging the TRtcDataServer(Sender).PeerAddr property in each. The only place I do NOT get the PeerAddr is in the "OnClientConnect" event, which is the very first event that triggers when a new client connection is ready to be accepted, before any connection properties have been read from the socket. In all the other events, the "PeerAddr" property is correctly populated. If you were using the "OnClientConnect" event before and you need access to the "PeerAddr" property, I recommend changing your event mapping to use the "OnConnecting" or "OnConnect" event instead.
If that's not the problem, then I will need more details or an example Project for testing. (http://sf.realthinclient.com/supportmail.gif) PS. There were a lot of changes and optimizations between RTC SDK v2.7 and 6.x, one of which was to reduce the number of socket API calls, for example by populating properties like "LocalAddr" and "PeerAddr" only once (when the data is expected to be available), instead of accessing the API every time the property is being used. That is most likely why you were getting a result from the PeerAddr when using the old RTC SDK version, but are not getting any results now. Best Regards, Danijel Tkalcec Title: Re: RtcHttpServer PeerAddr returns 0.0.0.0 Post by: SevenOut on May 27, 2014, 11:28:08 PM Yes, I was using "OnClientConnect". I switched the code over to use "OnConnect" and it appears to work just fine.
What, exactly, is the difference between "OnClientConnect" and "OnConnect"? Thanks! - Scott Title: Re: RtcHttpServer PeerAddr returns 0.0.0.0 Post by: D.Tkalcec (RTC) on May 30, 2014, 11:58:02 AM The OnClientConnect event is actually a relic from the past. With all the optimizations, it became obsolete.
I should probably have removed it years ago, but I've left it there for backwards compatibility. Best Regards, Danijel Tkalcec Title: Re: RtcHttpServer PeerAddr returns 0.0.0.0 Post by: DougB on August 12, 2014, 06:46:27 PM Perhaps it would be helpful to mark deprecated features, properties, methods and events as such in the documentation. ;)
IMHO, this makes it even more difficult to understand the framework when the documentation contains such outdated things (e.g., needing to call New and Release on a connection, which I took seriously when I read it). This caused me to waste a bunch of time going down a design path that I wouldn't have followed otherwise, among other things I have since learned from scouring the forum. Great software, but anything can use improvements. Just my respectful .02 :) Doug |