CM10228 / Programming Ib:   Lab 2

Concurrency and Networking

This lab will help you learn the basics of networking and threading in Java. The two main concepts required for Coursework 2.

At the end of this lab you will get to make a small instant messaging application that you can use to chat with people across a network (including the Internet!). This will require some threading and some networking. But we will start by introducing these separately.

If you don't make it to the chat program, don't worry. But try to at least get through the first three pages below.

Hopefully you have already had a read of Oracle's The Java Tutorials, in particular the pages for concurrency and networking. This lab sheet will work through this material and give you some exercises to try it out.

Contents:

  1. Concurrency (Threading)
  2. Networking
  3. Combining these
  4. Make a chat application

This lab should give you a really good basis for coursework 2. If you get stuck at any point on this sheet ask a tutor or on moodle.


page author: Andrew Chinery
last updated: 01 March 2013