• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Custom XML message socket listener

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to figure out the most elegant way to write a listener thread that constantly listens on a given Socket for incoming TCP/IP messages.

Each individual TCP/IP message is composed of 4 bytes followed an XML document. The first 4 bytes are an integer that tells how long the subsequent XML document is.

How would you write something that listens on a socket and can pick up and process a message like this?

What goes inside the while parentheses?


[ June 15, 2005: Message edited by: Carl Bradbury ]
reply
    Bookmark Topic Watch Topic
  • New Topic