Thread: data storage - struct or hash table

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385

    data storage - struct or hash table

    I am writing a proxy server, an internal table will need to keep track of requests so incoming traffic can be dropped if it has not been requested and maintain connection state.

    I will need to store

    Originating Internal IP (unsigned long)
    Destination IP (unsigned long)
    Source port (uint)
    Destination ports (uint)

    I will need to store a lot of these in data records and will need to access them qucickly. Would it be more efficient to store them in a hash table or a struct?
    Or is tere a more suitable data type?

    thanks
    Last edited by iain; 02-03-2005 at 09:50 AM. Reason: Additional info
    Monday - what a way to spend a seventh of your life

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. memory issue
    By t014y in forum C Programming
    Replies: 2
    Last Post: 02-21-2009, 12:37 AM
  2. Hash Table outputting incorrect number
    By Paul Skinner in forum C Programming
    Replies: 4
    Last Post: 11-20-2008, 06:19 AM
  3. Replies: 10
    Last Post: 05-18-2006, 11:23 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. Passing pointers between functions
    By heygirls_uk in forum C Programming
    Replies: 5
    Last Post: 01-09-2004, 06:58 PM