【问题标题】:Socket Server in Android and iOSAndroid 和 iOS 中的 Socket 服务器
【发布时间】:2023-03-30 08:59:01
【问题描述】:

是否可以在 iOS 和 Android 中创建套接字服务器(不是套接字客户端)?

套接字服务器将(在 iOS/Android 中)仅侦听传入的客户端并仅基于此做出反应。

【问题讨论】:

  • 你想让android mobile作为服务器反应吗?

标签: android ios sockets server


【解决方案1】:

是的。这是一个在 Android 上的服务器套接字和 iOS 上的客户端套接字之间工作的国际象棋游戏示例。

Kotlin 中的 Android 国际象棋: https://github.com/zhijunsheng/chess-kotlin-andr

Swift 中的 iOS 国际象棋: https://github.com/zhijunsheng/chess-uikit-ios

还有a demo video

【讨论】:

    【解决方案2】:

    是的,你可以!
    只需要获取phone IMEI而不是用户信息!
    但是这种方式不需要注册用户
    只需要在onResume 中获取IMEI 并将其发送到服务器而不是用户

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-24
      • 1970-01-01
      • 2014-02-19
      • 2021-08-12
      • 1970-01-01
      • 2012-12-16
      相关资源
      最近更新 更多