Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

socket question..

  Asked By: Gin    Date: May 10    Category: Java    Views: 544
  

I have a question about socket programming in java :
supose I have socket already established between server and client,
in server :
ss = new ServerSocket(port);
Socket s = ss.accept();
ObjectOutputStream dos = new
ObjectOutputStream(s.getOutputStream());
in client :
socket = new Socket(host,port);

is it legal if in client I want two type of input stream from this socket
stream, ex :
ois = new ObjectInputStream(socket.getInputStream());
dis = new DataInputStream(socket.getInputStream());

I don't know if this the problem or not in my program, but the program
always stuck in
this statement after first I declare the type of input stream is dis and
then I change it into
ois = new ObjectInputStream(socket.getInputStream());

if I change the type back into DataInputStream again then there's no
problem

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on socket question.. Or get search suggestion and latest updates.




Tagged: