0
내가 자바에서 다음 작업을 수행 할 때 내가 파이썬에서 안드로이드와 소켓 모듈의 표준 java.net.Socket의를 사용하고있어 :안드로이드 <--> 파이썬 소켓
sk = new Socket(addr, port);
input = new BufferedReader(new InputStreamReader(sk.getInputStream()));
output = new DataOutputStream(sk.getOutputStream());
...
output.writeUTF("connect 216082611046");
String message = input.readLine();
Log.wtf("cst", message);
그리고 파이썬에서 다음
...
connection, addr = server.accept()
print "Received connection from", addr
s = connection.recv(1024)
...
connection.sendall(ip) #ip is some string there
문제가 생깁니다 : java는 "connection.sendall (ip)"에서 보낸 메시지를 수신하지만 소켓을 닫을 때만 메시지를 계속 유지하고 수신 된 데이터를 기반으로 메시징을 계속 진행해야합니다. 소켓을 닫지 않고 대답을 얻을 수있는 방법이 있습니까?