Desperate Over Ecs!

This is a discussion on Desperate Over Ecs! within the C Programming forums, part of the General Programming Boards category; That's true -- however, that can occur under normal circumstances anyway, depending on latency. TCP packets can arrive in a ...

  1. #16
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    That's true -- however, that can occur under normal circumstances anyway, depending on latency. TCP packets can arrive in a different order than they were sent, I believe.

    If you wanted to have completely accurate (chronologically) messages, you'd be best off sending a timestamp with each message. But then again, the clients' clocks probably wouldn't be synchronized, so you'd have to use a reference time (say, the server) to do that. Of course, either of these schemes would be open to cracking -- modify the client a little, and you can have a message appear anywhere in the list.

    You could fix half of the problem by only sending times from the server to the clients, I suppose.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  2. #17
    #C-help
    Join Date
    Jun 2007
    Location
    Las Vegas
    Posts
    53
    TCP packets never arrive in a different order. UDP ones do!
    <<deleted because of colour and size abuse>>

  3. #18
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    Oh, well, what do I know.

    Still, delays could cause packets from one client to arrive after those from another, even though the packets from the first client were sent first chronologically.

    Then again . . . it's a chat program, right? Who cares! Display a ping-time-measurement if you want, and users can say "no, I really typed it before you -- my ping's 244!"

    Yay for plausible deniability.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Desperate !! In need of a helping hand...
    By yojimbo2005 in forum C Programming
    Replies: 20
    Last Post: 11-23-2006, 10:27 AM
  2. Debugging Help - I'm Desperate
    By Tman in forum Game Programming
    Replies: 2
    Last Post: 02-21-2006, 01:39 PM
  3. I don't like doing this but i'm desperate
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 07-21-2002, 07:44 PM
  4. Desperate for help - ugly nested if
    By baseballkitten in forum C Programming
    Replies: 4
    Last Post: 11-19-2001, 03:56 PM
  5. Desperate to get help w/ program
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 10-13-2001, 03:59 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21