Kaydet (Commit) 30791330 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Do display the computer name in the dialog when connection failed

The latestInstance lifecycle and mName initialisation was borked.

Change-Id: If7ef8a15fdc297e0fe6e401399a3b94dcd8d08c5
üst 2244bb14
...@@ -47,6 +47,7 @@ public abstract class Client { ...@@ -47,6 +47,7 @@ public abstract class Client {
CommunicationService aCommunicationService, CommunicationService aCommunicationService,
Receiver aReceiver) { Receiver aReceiver) {
mServer = aServer; mServer = aServer;
mName = aServer.getName();
mCommunicationService = aCommunicationService; mCommunicationService = aCommunicationService;
mReceiver = aReceiver; mReceiver = aReceiver;
latestInstance = this; latestInstance = this;
...@@ -92,7 +93,6 @@ public abstract class Client { ...@@ -92,7 +93,6 @@ public abstract class Client {
// TODO stream couldn't be opened. // TODO stream couldn't be opened.
e1.printStackTrace(); e1.printStackTrace();
} finally { } finally {
latestInstance = null;
onDisconnect(); onDisconnect();
} }
......
...@@ -37,7 +37,6 @@ public class NetworkClient extends Client { ...@@ -37,7 +37,6 @@ public class NetworkClient extends Client {
Receiver aReceiver) throws UnknownHostException, Receiver aReceiver) throws UnknownHostException,
IOException { IOException {
super(aServer, aCommunicationService, aReceiver); super(aServer, aCommunicationService, aReceiver);
mName = aServer.getName();
mSocket = new Socket(aServer.getAddress(), PORT); mSocket = new Socket(aServer.getAddress(), PORT);
mInputStream = mSocket.getInputStream(); mInputStream = mSocket.getInputStream();
mReader = new BufferedReader(new InputStreamReader(mInputStream, mReader = new BufferedReader(new InputStreamReader(mInputStream,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment