I tested to put a server on my own computer and tried to connect to it using a client that also lies on my computer, works great!
Then i tried to put the "server" on my friends computer (we are within the same network) then it takes a while and i get the error:
*note: I have tested to forward a port but it still doesnīt work.
Quote
Exception in thread "main" java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at Client.run(Client.java:32)
at Client.main(Client.java:14)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at Client.run(Client.java:32)
at Client.main(Client.java:14)
Any idea what i am doing wrong?
Greatfull for all help i can get!
The client
byte [] b = new byte[] { (byte)1x0,(byte)x38,(byte)24x,(byte)x6};
InetAddress ip = InetAddress.getByAddress(B)/>;
SocketAddress SA = new InetSocketAddress(ip,443);
Socket mySocket = new Socket();
mySocket.connect(SA,10);
PrintStream myPS = new PrintStream(mySocket.getOutputStream());
InputStreamReader input = new InputStreamReader(System.in);
BufferedReader reader = new BufferedReader(input);
String temp;
temp = reader.readLine();
myPS.println(temp);
Server:
ServerSocket mySS = new ServerSocket(8888); Socket SS_accept = mySS.accept(); BufferedReader SS_BF = new BufferedReader(new InputStreamReader(SS_accept.getInputStream())); String temp = SS_BF.readLine(); System.out.println(temp);

New Topic/Question
Reply




MultiQuote



|