Socket connection between Java and Objective C

前端 未结 2 610
栀梦
栀梦 2021-02-11 07:35

I am trying to write a server in Java and communicate with it using an iPhone app (Objective C). The connection goes through, and I can write data to the server, but I can\'t re

相关标签:
2条回答
  • 2021-02-11 08:11

    Looks like I needed to use read:maxLength: instead. Works fine now.

    0 讨论(0)
  • 2021-02-11 08:26

    you never send a linefeed \n to the java side BufferedReader uses these as delimiters for readLine();

    _dataToSend = [[NSData dataWithBytes:"This is a test\n" length:16] retain];
    
    0 讨论(0)
提交回复
热议问题