RTC Forums
November 24, 2024, 12:10:45 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: RtcHttpServer PeerAddr returns 0.0.0.0  (Read 5411 times)
SevenOut
RTC Expired
*
Posts: 24


« 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
Logged
SevenOut
RTC Expired
*
Posts: 24


« Reply #1 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.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #2 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.



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
Logged
SevenOut
RTC Expired
*
Posts: 24


« Reply #3 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
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #4 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
Logged
DougB
Newbie
*
Posts: 19


« Reply #5 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. Wink 

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  Smiley

Doug
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.026 seconds with 17 queries.