Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Help

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanna create a client-server application and need to transfer various kinds of information between C-S, these information includes identity validation , talking and some others : And my question is : Can i declare numbers of input streams and output streams in a single socket connection just like "new data input stream(socket.getinput stream() )"? If yes , How can i do that ?If no, Does that mean i should creat numbers of input(output)streams for each kinds of information using numbers of socket connection ? I am looking forward to receiving your earliest reply . Thanks !
 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not quite sure what you mean. I am assuming you have lots of different messages and want to create a new type of stream for each one, right?
If so, this is not how you really want to do it.
If you have different messages being sent from a client to a server, I recommend you wrap the message in XML.
<message_type_x>
<value>123</value>
</message_type_x>
<message_type_y>
<value>hello</value>
</message_type_y>
This will make your system to be scalable.
For further information out how to implement a client-server app see the following resources:
-- this shows a flash client talking to a Java server using XML.
--------------------------------------------------------------------
http://hotwired.lycos.com/webmonkey/multimedia/shockwave_flash/tutorials/tutorial9.html
-- ibm tutorial showing how to setup a very simple client server connection. beginners should START HERE - some knowledge of threads would help.
---------------------------------------------------------------------------
http://www-106.ibm.com/developerworks/edu/j-dw-javasocks-i.html?S_TACT=103AMW02&S_CMP=EDU
 
Pay attention! Tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic