• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

communciate with c server

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
reply
    Bookmark Topic Watch Topic
  • New Topic