<< Chapter < Page | Chapter >> Page > |
This module is one in a collection of modules designed for teaching INEW 2338 Advanced Java (Web) at Austin Community College in Austin, TX. More specifically, it is one in asub-collection of modules designed for teaching network programming in that course. The purpose of this module is to introduce the student to the Socket class.
I recommend that you open another copy of this module in a separate browser window and use the following links to easily find and view the Figuresand Listings while you are reading about them.
Sockets in Java come in at least three varieties that are implemented by the following Java classes
The first two socket classes represent TCP and UDP communications respectively.
Generally, these two socket classes are used to implement both clients and servers, while the ServerSocket class is only used to implement servers.
This module will concentrate on the use of the Socket class. The DatagramSocket class will be covered a future module. In the meantime, you can read about the DatagramSocket class and other interesting topics in my earlier publications at:
In addition, you may find a great deal of useful information in my older publications that are accessible at Programming Oldies But Goodies .
A low-level mechanism
Socket programming provides a low-level mechanism by which you can connect two computers for the exchange of data. One of those is generally considered tobe the client while the other is considered to be the server .
The client initiates a connection with a server. Servers wait for a clients to initiate connections.
A mutually acceptable application protocol
The governing protocol will determine what happens after the connection is made. In order for two computers to communicate effectively, they must eachimplement some mutually acceptable application protocol.
Notification Switch
Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?