Answer the question
In order to leave comments, you need to log in
Why java socket doesn't forward data and hangs on socket.getInputStream() on windows 10?
Wrote a simple java code to send data via socket:
server:
try{
ServerSocket ss=new ServerSocket(6667);
Socket s=ss.accept();
ObjectInputStream io=new ObjectInputStream(s.getInputStream());
ObjectOutputStream oo=new ObjectOutputStream(s.getOutputStream());
oo.writeObject("hello world!!!");
}catch(Exception e)
{}
try{
Socket socket=new Socket(InetAddress.getByName("127.0.0.1"),6667);
ObjectInputStream io=new ObjectInputStream(socket.getInputStream());
ObjectOutputStream oo=new ObjectOutputStream(socket.getOutputStream());
System.out.println((String)io.readObject());
}catch(Exception e)
{}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question