Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom XML message socket listener  RSS feed

Carl Bradbury
Posts: 3
  • Mark post as helpful
  • send pies
  • 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 ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!