简体   繁体   中英

Connecting to C# Server from iOS

I am trying to make an iOS apps which connects to a C# server (using TCP) programmed similarly to that shown here . On the client (iOS) side, I use CFStreams and the CFStreamCreatePairWithSocketToHost method to connect to my cloud server. I have followed the tutorial found here precisely for the iOS side. A copy of the main connection program can be found here .

Unfortunately, when I run the app, I never get a NSStreamEventHasBytesAvailable event from the inputStream, even though the server is programmed to send a message to the client immediately after the connection has been made. Can someone help me fix this?

All help is greatly appreciated, and I always accept at least one answer!

You may want to print out on the server side what was received and what was sent. And you may want to read this, as he does a good job of giving ideas of how to get more info:

bytesWritten, but other device never receives NSStreamEventHasBytesAvailable event

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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