android - Send int array from java to c with Socket -


i want send int array android client linux server socket.

i have int[] angleint , has -10,15,20.

my goal linux server can receive -10,15,20.

this android code send part

public void sendangle(float[] anglevalue) {      try {          angleint[0] = (int)(anglevalue[0]*10);         angleint[1] = (int)(anglevalue[1]*10);         angleint[2] = (int)(anglevalue[2]*10);          log.d("angle", angleint.tostring());         out.println(angleint);       } catch (exception e) {      } } 

and linux server code receive part

while( (read_size = recv(client_sock , client_message , 20 , 0)) > 0 ) {     //send message client     printf(client_message); } 
  • char client_message[20]
  • int[] angleint = new int[3]
  • printwriter out

if send string android linux, works fine.

i'd receive array save array's value separate variables.

thanks in advance.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -