You don’t translate code line by line. Different platforms and even different frameworks use different styles of API.
Since your question doesn’t say what you are trying to do, I can only recommend that you read more about how stream and socket programming works on iOS in
- the Stream Programming Guide, or
- the CFNetwork Programming Guide (if you want to read more about lower level (Core Foundation) networking code on iOS), or
- the Networking Overview (if you want to read more about networking code in general on iOS)
solved What is the iOS equivalent to Android Socket programming code?