Tuesday, January 21, 2014

[ECE361] Lab 01 - Socket Programming

So basically, today was a day I started programming in Java seriously.

I tried programming in Java but it was so different from C and C++ or any other languages I know that I just forgot about it.
I find the language very wordy for what it does (like how I need to first write the main function inside class function while "void"-ing the main!!!) Since I was always told not to use void main() in C, it just appeared awkward to me at first.

Anyways, without much difficulties, my partner and I were able to finish the lab within 2 hours where 1 hour was allocated for the TA in teaching us the language.

Then in the next 20 minutes, we were able to complete the optional "thread" lab.

The purpose of the lab was to create us a client-server architecture on the same machine.
Then after this step, we were to create a chatting program where there were no real distinctions between the client and the server except the server was listening to establish connection at first.

The IDE we used was eclipse.
With the functionality of auto-completion of words, programming in Java was so easy. (Ctrl + Space)
Moreover, eclipse has helped me add libraries whenever I tried to use a built-in function like InputStreamReader.

However, there is a question I need answering to:
Q: What does the class WriteThreadClass implements Runnable mean?

Download: (University of Toronto (U of T) ECE361 Lab 1)
lab01.zip