Java Chat Client - Class Socket, Low-level

The purpose of this assignment was to:

The description and my solution of the Java Chat Client -assignment can be viewed and/or downloaded at the bottom of this page.

Low-level Connections with Stream Sockets and TCP

Unlike high-level connections low-level connections aren't preconfigured.

Stream sockets use TCP which is a connection-oriented and reliable - but slow - low-level protocol that acts as a message carrier for high-level protocols.

TCP is connection-oriented because two network nodes can only communicate after they completed a handshaking procedure to create the connection.

TCP is reliable because data sent by TCP can't be lost. The protocol marks all packets of information that it transmits with a sequence number. This allows for retransmission of packets that go missing or are damaged since the receiving end can ask for those packets by looking up the sequence numbers of the packets it receives.

Because of this retransmission capability of packets, TCP is also considered a slow protocol.

Client-Server Paradigm, Client-Side and Server-Side

Client-Server is a network application architecture which separates the client - that usually has a GUI - from the server.

Each instance of the client software can send requests to the server. The server replies(serves) the client with requested data.

In short: On the client-side clients make requests. On the server-side servers respond to requests.

What are Client Sockets and Java's Socket Class?

A socket is an endpoint for communication between two applications.

Java's Socket class implements client sockets (or simply "sockets").

The actual workhourse of the Socket class is an instance of the SocketImpl class. An application can - by changing the socket factory that creates the socket implementation - configure itself to create sockets more appropriate to the local firewall.

Assignment Description

Create a Java Chat Client application that can send and receive text messages. Clients should be able to connect to a chat server by using stream sockets.

My Solution, Assignment Files

Note: To try the Chat Client you first need to download the Java Chat Server.

«  Previous Next  »