Multiple Socket Problem
Hi Friends,
I am facing a strange problem while dealing with multiple sockets. Let me give you some brief description. I have two socket connected on same IP and PORT. Let's say socket and socket. Socket will control the data flow on the socket.
Step-1=> Socket connects with server on some IP and PORT.
Step-2=> Upon Successful connection exchange some data for shakehand with server.
Step-3=> Upon successful shackhand socket2 will initiate connection with server on same IP and PORT on which socket1 is currently connected.
Step-4=> Upon successfull connection of socket2, socket1 goes in waiting state. In other words socket1 is waiting for some data.... let's say 100 bytes.
Step-5=> As socket2 is now connected I am getting continues flow of data on it(socket1). To control flow now I am sending some command on socekt1.
Step-6=> As socket1 is waiting for data, it gets responce immidiatly...... Huh and here problem occurs.
I am always receives at most 100 bytes on socket1 and it never excced this size. But I am getting more bytes lets say 200 on socket1 although I am restricting number of bytes to read in inputstream's read method.
So friends what should be problem?
Waiting for your reply....

