Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!

Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

communciate with c server  RSS feed

lolita ling
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!