Socket connection between Java and Objective C

前端 未结 2 615
栀梦
栀梦 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: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];
    

提交回复
热议问题