• Post Reply Bookmark Topic Watch Topic
  • New Topic

real time networking  RSS feed

 
leon matthew
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm not sure if i've put this in the correct forum - apologies if this is the incorrect one.
I'm doing a two player networked game in java, and i was going over the theory of the networking - with this game it has to be real time because the players are fighting.
Is it possible to *really* network in real time with java? If my understanding of java is right, then the "real-timeness" can be affected by garbage collection and the scheduling by the OS?
Does anyone have any good links or information on real time networking in java?
Thanks
 
Marilyn de Queiroz
Sheriff
Posts: 9082
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Everything is affected by the scheduling by the OS. That is one of the functions of the OS, to schedule processes and threads. As far as I know, networking in Java will not be affected more than networking in any other language.

Are you creating and discarding lots of Objects during your game (while you are actually playing it)? Again, this would not affect the networking part of the game, but it might slow down the player's response if he has to wait until his JVM collects some garbage that he has discarded.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Real-time" performance is not an attribute aof any high-level programming language. Rather, it is a feature on the operating system that specifies a bounded (and minimal) latency in response to an interrupt. "Real-time Java" is no more meaningful than "real-time C" or "real-time LISP."
However, the network itself -- packet losses, router hiccups, etc., are very likely sources of performance impediments. The best the programmer can do is take those delays and errors into account; you can't program around them, not in any language.
Garbage collection is the least of your optimization worries.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!