Added socket code

Check wheather socket is connected or not