Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Networking & Multiplayer / Re: 'Server-initiated' communication on: 2003-06-08 15:39:42
Quote

... running a servlet on both sides you'll get the same poor performance ...


You're right, it's slow to use a HTTP servlet. I only mentioned the both-sided-servlet approach because rajit_b said they are currently using a servlet - so why throw it all over when it might not be necessary?

Quote

If you want fast response times, you absolutely aren't going to get it with servlets or HTTP for that matter.


You don't have to use HTTP for servlets, the servlet spec lets you implement any protocol, i.e HTTP, FTP, HTTPS and your home brewed protocols if you want. But for fast-paced games, all this servlet stuff is definitely overkill and much too slow.

I'd prefer to implement a custom protocol on top of TCP/IP or UDP if speed is of importance.


phil

PS: Is rajit_b still with us? He's so quite...n
2  Game Development / Networking & Multiplayer / Re: 'Server-initiated' communication on: 2003-06-08 09:44:21
Quote

... keep an HTTP connection open over port 80 (keep alive http) which is bad.


full ack, persistent HTTP (and HTTP in general) is bad for games which need fast response times.

Quote

... clients poll the server at intervals,


IMHO that's no good either:

If there are few messages being sent, this would cause quite a lot of unnecessary traffic because there won't be a message waiting everytime the client polls the server.

If there are many messages sent and the client poll interval is too long, messages could pile up on the server and eventually crash it due to an out of memory error (only in rare cases of course)

I'd prefer some kind of "fire and forget" communication, where the server just writes the message to a stream/whatever and the client gets it instantly.

Just my 2 cents,
phil
3  Game Development / Networking & Multiplayer / Re: 'Server-initiated' communication on: 2003-05-24 17:00:53
Could you explain how you know which clients are "connected" to the servlet? Assuming you call the servlets via HTTP which is stateless, you track clients with a session (cookie or request parameter).

I can think of two ways to let your server carry out stuff to the client:

  • Equip the client application with a servlet itself to handle the incoming data from the server. This would be an overkill, as you would have to bundle your client with a servlet engine.
  • Or you might drop your servlet idea completely in favor of persistent connections and a custom protocol via TCP/UDP - this would also be much faster than the servlet approach.

One major drawback in you client-server design seems to me, that servlets don't do persistent connections (as far as I know): They get a request, service() it and close the connection. This means, you'll always have to open a new connection, which will make it quite hard for you to "achieve quick response/action"  :-/

phil
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (11 views)
2014-07-29 18:09:19

Riven (8 views)
2014-07-29 18:08:52

Dwinin (9 views)
2014-07-29 10:59:34

E.R. Fleming (25 views)
2014-07-29 03:07:13

E.R. Fleming (10 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (27 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!