简体   繁体   English

如何在Android / IOS上将TIdTCPClient连接到TIdTCPServer?

[英]How to connect TIdTCPClient to TIdTCPServer on Android/IOS?

Indy TIdTCPClient Error: socket error # 113 no rout to host when connecting from Android to PC. 从Indy TIdTCPClient错误: socket error # 113 no rout to host从Android连接到PC时socket error # 113 no rout to host TIdTCPClient

Hello, i know i asked a lot of questions about Indy Components lately, but i'm having a real problem trying to connect TIdTCPClient in my Android device to TIdTCPServer which is on my PC Windows 10. 您好,我知道我问了很多关于Indy组件近来的问题,但我有尝试连接一个真正的问题TIdTCPClient在我的Android设备TIdTCPServer这是我的电脑的Windows 10上。

I have to add that i am using WIFI on LAN network, also all devices have WIFI access. 我必须补充一点,我在局域网上使用的是WIFI ,而且所有设备都可以访问WIFI

Also, i have to mention that my windows 10 FireWall is Off , so it cannot be firewalled somehow. 另外,我不得不提到Windows 10 FireWall关闭 ,因此无法以某种方式对其进行防火墙保护 In addition, there's no antiviruses active in my windows 10 platform, not even MCAfee . 此外,我的Windows 10平台中没有激活的防病毒软件,甚至MCAfee没有

This is the error i get when i try to connect from my Android to PC : 这是我尝试从Android连接到PC时遇到的错误

socket error # 113 no route to host

Note: I can connect when i use both sides TIdTCPClient and TIdTCPServer on same Machine . 注意:当我在同一计算机上同时使用TIdTCPClientTIdTCPServer时,可以连接。

Connection Template: 连接模板:

This is my problem: 这是我的问题:

1- Connect from PC1 to PC2 = " Failed ". 1-从PC1连接到PC2 =“ 失败 ”。

2- Connect from PC1 to PC1 = " Success ". 2-从PC1连接到PC1 =“ 成功 ”。

3- Connect from PC1 to Android/IOS = " Failed ". 3-从PC1连接到Android / IOS =“ 失败 ”。

4- Connect from Android/IOS to PC1 = " Failed ". 4-从Android / IOS连接到PC1 =“ 失败 ”。

On Failed i get the error above. 失败,我得到上面的错误。

XML UPDATE: XML更新:

<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.embarcadero.watcher"
        android:versionCode="1"
        android:versionName="1.0.0"
        android:installLocation="auto">

    <!-- This is the platform API where NativeActivity was introduced. -->
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_CALENDAR" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_CALENDAR" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-feature android:glEsVersion="0x00020000" android:required="True"/>
    <application android:persistent="False" 
        android:restoreAnyVersion="False" 
        android:label="watcher" 
        android:debuggable="True" 
        android:largeHeap="False"
        android:icon="@drawable/ic_launcher"
        android:theme="@style/AppTheme"
        android:hardwareAccelerated="true">



        <!-- Our activity is a subclass of the built-in NativeActivity framework class.
             This will take care of integrating with our NDK code. -->
        <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
                android:label="watcher"
                android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
                android:launchMode="singleTask">
            <!-- Tell NativeActivity the name of our .so -->
            <meta-data android:name="android.app.lib_name"
                android:value="watcher" />
            <intent-filter>  
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter> 
        </activity>

        <receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" />

    </application>
</manifest>
<!-- END_INCLUDE(manifest) -->

看起来像是我的WIFI路由器中的问题,因为当我更换为另一个路由器时,它工作正常,无论如何,感谢您的帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM