RTC Forums
May 14, 2024, 11:40:04 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Problems with TRtcUdpClient in iOS  (Read 3723 times)
Christen
RTC Expired
*
Posts: 9


« on: May 04, 2012, 06:24:43 PM »

Hello,
I´m writing a SNTP client for iOS using the TRtcUdpClient. the problem that I´ve faced is that the Windows code works fine. I´ve used ServerAddr = '1.es.pool.ntp.org' and ServerPort = '123' and all other properties with default values.
In the case of iOS the Connect method calls, after a while, event OnConnectError with exception message '#61: connection refused'.
I´ve tried the same code in the simulator (iOS 5.1) and in the device  (iOS 5.1) with same results.

Thank you.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: May 04, 2012, 06:29:31 PM »

UDP components only work on Windows, and there are no plans to make UDP components for non-Windows platforms.

From the RAW component set, only TRtcTcpClient and TRtcTcpServer components work on non-Windows platforms, but if you want to use them on iOS or MacOSX, you will need to call the "NeedMoreData" method to signal the components when they should wait for input, so it's not as easy as on Windows.

Best Regards,
Danijel Tkalcec
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #2 on: May 04, 2012, 07:41:21 PM »

Hint: If you need to send E-Mails from your iOS application, unless you want to go directly to the iOS API and use the built-in E-Mail application, you might want to check a "SMTP over HTTP tunnel". When writing apps for mobile devices, I would recommend sticking to the HTTP protocol and using Port 80 if you want to avoid problems with restrictions placed by some mobile providers. While communication over HTTP will always work, raw TCP/IP and UDP communication can get completely blocked by some mobile providers (a lot of them use proxies to save bandwidth), which would make your App highly dependable on a mobile provider.

And if you are writing an application for internal use, where you will have a HTTP Server for other things, you might consider writing your own SMTP/POP3 over HTTP tunnel and using that for all E-Mail tasks from your mobile applications.

Best Regards,
Danijel Tkalcec
Logged
Christen
RTC Expired
*
Posts: 9


« Reply #3 on: May 07, 2012, 09:18:21 AM »

UDP components only work on Windows, and there are no plans to make UDP components for non-Windows platforms.

From the RAW component set, only TRtcTcpClient and TRtcTcpServer components work on non-Windows platforms, but if you want to use them on iOS or MacOSX, you will need to call the "NeedMoreData" method to signal the components when they should wait for input, so it's not as easy as on Windows.

Best Regards,
Danijel Tkalcec

It's a pity you don't have plans to port UDP raw components to iOS. There exists other alternatives in Objetive C (see https://github.com/robbiehanson/CocoaAsyncSocket).
It would have been easier for me to use your components instead.

Best regards
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.023 seconds with 15 queries.