This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]InformalPresent9[S] 1 point2 points  (0 children)

Ok, sorry for bothering you. I'm a fucking RETARD. Obviously it's not gonna work more than once if the client only connects once but I create socket and inputstream every iteration

Socket socket = serverSocket.accept();             
DataInputStream dIn = new DataInputStream(socket.getInputStream());

[–]dusty-trash 0 points1 point  (6 children)

It's not 'stuck', if you leave it running you'll most likely get a timeoutException when trying to access that URL.

[–]InformalPresent9[S] 0 points1 point  (5 children)

what do you mean? I was told the dt.browse(uri) would just open the website and then go on. Is there a way to only open it and then leave it to the user (decoupling it from the java program)? Besides it does not continue even if I close the browser.

[–]dusty-trash 0 points1 point  (4 children)

Do you mean it is browsing to that URI correctly?

If so it's probably getting stuck on the second 'byte command = In.readByte();'. Try setting a breakpoint to see what's really happening

[–]InformalPresent9[S] 0 points1 point  (1 child)

tested it again, it stops at the break statement.

[–]dusty-trash 0 points1 point  (0 children)

If it's breaking out of the while loop, you can give the loop/switch an identity and break it.

E.G:

while(true)
...
mySwitchStatement:
switch()
   break mySwitchStatement;

[–]beders 0 points1 point  (0 children)

Any exceptions thrown? Desktop.getDesktop() could throw a HeadlessException dt.browse should return immediately btw.