2) Optimize your CSS
3) Obfuscating e-mail address using CSS
4) CSS that helps to detect ClickJacking
5) Gzipping CSS
.......................................................................................................................
1) Accessing Excel,Word etc using javascript
2) Executing .exe files from Web Page
3) Ajax in JavaScript Vs jQuery
.......................................................................................................................
1) Socket Programming
2) Rmi
3) Using URLConnection class
4) Creating indexes in Oracle
5) Installing https certificates into keystore
6) Base 64 encoding
It goes on...!
Don't tell me you've never chatted on those instant messengers like yahoo, msn and aol. But its OK if you never understood what goes on behind the scene; after all, thats what we are here for. Lets say you've installed one of those instant messengers on your computer. After you run it and enter your user name and password, the messenger tries to connect to its server (say, the yahoo server). What exactly does this 'connect' mean?
Every computer on a network has an IP address. This address is like your house address, something that identifies your computer uniquely, allowing others to communicate with your computer. I wont go much into IP addresses, but let me just tell you that an IP address looks something like this - 64.104.137.158 - a set of numbers separated with dots. However, some computers with rich owners will also choose to have a domain name in addition to this sick looking number, so that people can easily identify them. A domain name looks far more sane - like www.yahoo.com. There are some special computers on the Internet, whose sole purpose in life is to translate the domain name to IP address and vice versa.
Now, you know that many programs can run on the same computer, don't you? Lets say that, there are some 10 programs running on a certain computer. To add to the confusion, lets say all of them are waiting for other computers to contact them. Imagine it like this - 10 of you share a big office space and a single telephone - and all of you expect calls from your own clients. How will you handle this? Perhaps appoint one person who'll hand over the call to the right person. Possible, but an undeniable menace. This will mean, when one of you take the call, other clients will not be able to reach the rest of you. Besides, its a pain to have a person route the calls to the right people. You must have guessed what I'm heading at - if all those programs running on a single computer proudly ask their clients to contact them on a certain IP address, their clients are not going to be pleased. The idea is... having a separate IP address per program, right? WRONG. Thats out of question. Its like asking for a separate office for each of you. Wont separate phone numbers suffice? Yes. In networking parlance, we call these 'separate phone numbers' as ports. A port is just a simple number - each program running on the same computer can choose to have a unique port number to identify itself to the outside world. REMEMBER - these ports are not slots on your computer hardware - dont think you can find them if you try hard enough. They are just logical numbers. Now the point should be clear. We have an IP address that lets the other computers look for a certain computer on the network. And we have a port number that'll identify a certain program running on that computer. Understand that, two programs running on different computers CAN use the same port number. Two houses on different streets can have the same house number, can't they? So, finally, we are almost there - just to scare you a bit, lets derive a formula -
An IP address = uniquely identifies a computer on the network. A port number = uniquely identifies a program running on a computer.
Adding the above equations,
An IP address + A port number = _______
In other words, A _____ = uniquely identifies a program on the network
If you guessed it right, thanks, my effort didn't go waste. If you didn't, no problem, go back and read from the beginning, or google for a better tutorial. The ____ is... SOCKET!
To summarize, a socket is a combination of an IP address and a port. A socket address lets other computers on the network locate a certain program running on a certain computer. You may represent a socket address like 64.104.137.58:80, where 64.104.137.58 is the IP address and 80 is the port number.
I hope I gave all of u fabulous introduction to world of network programming. Feel free to shoot your questions, I'll answer them if I can. You can also give me your valuable feedback, suggestions, or the mistakes you found in this tutorial.
Below are the codes for Server and client respectively! (I always find easy to create and run java project using Eclipse oy My eclipse).
- V Karthik`s explination of socket programming!
- Loyola Marymount University.