Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我要做的是为主机名和端口创建 2 个套接字。一个连接链接到输入和输出流。一个连接仅链接到输出流。
第一个连接首先使用 CFStreamCreatePairWithSocketToHost 创建并打开相应的流,然后使用 readstream 创建第二个连接为 nil。
我发现我可以通过两个输出流向远程服务器发送数据。但 iPhone 无法从远程服务器接收数据。
ps 如果只建立第一个连接,从服务器发送和接收数据是没有问题的。
也许你必须尝试不同的端口..