Java Socket programming is very good introductory blog
http://haohaoxuexi.iteye.com/blog/1979837
More detailed explanation about Socket and ServerSocket
http://www.cnblogs.com/rond/p/3565113.html
Socket Demo with multi-person chat function
http://www.pudn.com/downloads466/sourcecode/java/jsp/detail1955007.html
Heartbeat detection long connection
http://coach.iteye.com/blog/2024444