• Post Reply Bookmark Topic Watch Topic
  • New Topic

communciate with c server  RSS feed

 
lolita ling
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!everyone!
I have a java program work as a socket client to communciate with the c server.
the java client send a String to the c side server,receive the reply.but the reply String's length is unknow.
I use OutputStream.write(byte[]) to send String to c server.I worked fine.

my question is how should I receive the String from c side?the c return a string ends with '\0', how can I trim it. Can somebody show me the working code.

thanks in advance!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!