Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Hash Tables

Hash Tables

Scheduled Pinned Locked Moved Visual Basic
csharpsysadmincryptographyhelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi, Hash Tables can contain lots of objects and are very useful. But if you want to organise a whole bunch of TCPClient objects are they the way to go or is there some other way? If Hashtables are the best way to go then how would you go about checking when data has arrived and knowing which object to send data from? And where would threading come into this? Would you create a hashtable of threads running TCPClients or create a new thread only when needed? You've probably guessed I'm trying to develop my own server class, there's no specific reason for this aside from the fact I want to learn how to do this sort of thing. Any help is appreciated.

    --- Assimilating Knowledge irc.heavenlyplace.net #vb

    J 1 Reply Last reply
    0
    • L Lost User

      Hi, Hash Tables can contain lots of objects and are very useful. But if you want to organise a whole bunch of TCPClient objects are they the way to go or is there some other way? If Hashtables are the best way to go then how would you go about checking when data has arrived and knowing which object to send data from? And where would threading come into this? Would you create a hashtable of threads running TCPClients or create a new thread only when needed? You've probably guessed I'm trying to develop my own server class, there's no specific reason for this aside from the fact I want to learn how to do this sort of thing. Any help is appreciated.

      --- Assimilating Knowledge irc.heavenlyplace.net #vb

      J Offline
      J Offline
      JasonSmith
      wrote on last edited by
      #2

      Start simple. Use a new thread for each TCPClient. Actually, use one thread for the TCPListener to get new connections. On each new connection (TCPClient), invoke a new thread to handle it. When the TCPClient closes, you let the thread finish. In real world use, you'll find that this is very effective and a lot more scalable than you might at first think.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups