Skip to main content

Posts

Showing posts from August, 2018

Java Socket Basics(Socket Programming in Java) Part-1(TCP)

Hi friends, This post is about the Java Socket Programming . I know there are a lot of article and post are available over the internet about Java Socket Programming but all the content like the perquisite of socket programming, example of TCP and UDP is here at one place. So first question, what is TCP and UDP and what is the difference between these two. See below- Perquisite:- There are several things related to socket programming in java which you must not ignore... Do not forget to close the stream or socket connection when the related task is done. Recommended to use try with resource  whenever it is possible. If you are not dealing with  try with resource , then it is highly recommended to close all the resources and related sockets in finally block. java.net.SocketException: Too many open files::   This is an usual exception which generally thrown by Socket. So the question is What may be the possible reasons for  this exception. So go...