Chapter 29. Networking Basics
This chapter runs through networking fundamentals and explains basic network programming with sockets, URLs, and servlets. It serves as background for the next three chapters on networked games. Chapter 30 is about online chat, the "hello world" of network programming. I will look at three chat variants: one using a client/server model, one employing multicasting, and one illustrating chatting with servlets. Chapter 32 describes a networked version of the FourByFour
application, a turn-based game demo in the Java 3D distribution and revisits the Tour3D
application in Chapter 18 (the robot walking about a checkerboard landscape) and adds networking to allow multiple users to share the world. I will discuss some of the advanced issues concerning networked virtual environments (NVEs), of which NetTour3D
is a simple example.
This chapter provides:
Descriptions of the core attributes of network communication
Explanations of IP, User Datagram Protocol (UDP), Transmission Control Protocol (TCP), network addresses, and sockets
Overviews of the client/server and peer-to-peer models
Four client/server applications, illustrating the sequential, threaded, nonblocking multiplexing, and UDP multiplexing techniques
A small peer-to-peer application, as an example of UDP multicasting
A discussion of the programming problems caused by firewalls, motivating an introduction to URLs and servlets for HTTP tunneling
A few words about Java networking with JSSE, RMI, and Jini
Tip
The ...
Get Killer Game Programming in Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.