mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 15:15:25 +02:00
[257321] [dstore] "Error binding socket" should include port of the failed socket
This commit is contained in:
parent
57375d4fe9
commit
6b12909d73
2 changed files with 26 additions and 9 deletions
|
@ -20,6 +20,7 @@
|
|||
* David McKnight (IBM) - [225507][api][breaking] RSE dstore API leaks non-API types
|
||||
* David McKnight (IBM) - [226561] [apidoc] Add API markup to RSE Javadocs where extend / implement is allowed
|
||||
* David Dykstal (IBM) [235284] Cancel password change causes problem
|
||||
* David McKnight (IBM) - [257321] [dstore] "Error binding socket" should include port of the failed socket
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.dstore.core.client;
|
||||
|
@ -58,6 +59,7 @@ import org.eclipse.dstore.internal.core.client.ClientCommandHandler;
|
|||
import org.eclipse.dstore.internal.core.client.ClientReceiver;
|
||||
import org.eclipse.dstore.internal.core.client.ClientUpdateHandler;
|
||||
import org.eclipse.dstore.internal.core.server.ServerCommandHandler;
|
||||
import org.eclipse.dstore.internal.core.server.ServerReturnCodes;
|
||||
import org.eclipse.dstore.internal.core.util.ExternalLoader;
|
||||
import org.eclipse.dstore.internal.core.util.Sender;
|
||||
import org.eclipse.dstore.internal.core.util.ssl.DStoreSSLContext;
|
||||
|
@ -912,11 +914,16 @@ public class ClientConnection
|
|||
|
||||
public boolean isKnownStatus(String status)
|
||||
{
|
||||
return status.equals(IDataStoreConstants.CONNECTED) ||
|
||||
boolean known = status.equals(IDataStoreConstants.CONNECTED) ||
|
||||
status.equals(IDataStoreConstants.AUTHENTICATION_FAILED) ||
|
||||
status.equals(IDataStoreConstants.UNKNOWN_PROBLEM) ||
|
||||
status.startsWith(IDataStoreConstants.SERVER_FAILURE) ||
|
||||
status.equals(IDataStoreConstants.PASSWORD_EXPIRED) ||
|
||||
status.equals(IDataStoreConstants.NEW_PASSWORD_INVALID);
|
||||
|
||||
if (!known){ // check for bind error
|
||||
known = status.startsWith(ServerReturnCodes.RC_BIND_ERROR);
|
||||
}
|
||||
return known;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
* Noriaki Takatsu (IBM) - [226237] [dstore] Move the place where the ServerLogger instance is made
|
||||
* David McKnight (IBM) - [226561] [apidoc] Add API markup to RSE Javadocs where extend / implement is allowed
|
||||
* Noriaki Takatsu (IBM) - [242968] [multithread] serverSocket must be closed when an exception happens in Accept
|
||||
* David McKnight (IBM) - [257321] [dstore] "Error binding socket" should include port of the failed socket
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.dstore.core.server;
|
||||
|
@ -330,7 +331,6 @@ public class ConnectionEstablisher
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -347,6 +347,10 @@ public class ConnectionEstablisher
|
|||
return serverSocket;
|
||||
}
|
||||
}
|
||||
if (serverSocket == null){
|
||||
_msg = ServerReturnCodes.RC_BIND_ERROR + " on ports " + portStr; //$NON-NLS-1$
|
||||
System.err.println(_msg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -360,6 +364,10 @@ public class ConnectionEstablisher
|
|||
{
|
||||
serverSocket = sslContext.getServerSocketFactory().createServerSocket(port);
|
||||
}
|
||||
catch (BindException e){
|
||||
_msg = ServerReturnCodes.RC_BIND_ERROR + " on port " + port + ": " + e.getMessage(); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
System.err.println(_msg);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_dataStore.trace(e);
|
||||
|
@ -371,6 +379,10 @@ public class ConnectionEstablisher
|
|||
{
|
||||
serverSocket = new ServerSocket(port);
|
||||
}
|
||||
catch (BindException e){
|
||||
_msg = ServerReturnCodes.RC_BIND_ERROR + " on port " + port + ": " + e.getMessage(); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
System.err.println(_msg);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_dataStore.trace(e);
|
||||
|
@ -425,8 +437,6 @@ public class ConnectionEstablisher
|
|||
_serverSocket = createSocket(portStr);
|
||||
if (_serverSocket == null)
|
||||
{
|
||||
System.err.println(ServerReturnCodes.RC_BIND_ERROR);
|
||||
_msg = ServerReturnCodes.RC_BIND_ERROR;
|
||||
_continue = false;
|
||||
}
|
||||
else
|
||||
|
@ -461,25 +471,25 @@ public class ConnectionEstablisher
|
|||
}
|
||||
catch (UnknownHostException e)
|
||||
{
|
||||
System.err.println(ServerReturnCodes.RC_UNKNOWN_HOST_ERROR);
|
||||
System.err.println(ServerReturnCodes.RC_UNKNOWN_HOST_ERROR + ':' + e.getMessage());
|
||||
_msg = ServerReturnCodes.RC_UNKNOWN_HOST_ERROR;
|
||||
_continue = false;
|
||||
}
|
||||
catch (BindException e)
|
||||
catch (BindException e)
|
||||
{
|
||||
System.err.println(ServerReturnCodes.RC_BIND_ERROR);
|
||||
System.err.println(ServerReturnCodes.RC_BIND_ERROR + ':' + e.getMessage());
|
||||
_msg = ServerReturnCodes.RC_BIND_ERROR;
|
||||
_continue = false;
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
System.err.println(ServerReturnCodes.RC_GENERAL_IO_ERROR);
|
||||
System.err.println(ServerReturnCodes.RC_GENERAL_IO_ERROR + ':' + e.getMessage());
|
||||
_msg = ServerReturnCodes.RC_GENERAL_IO_ERROR;
|
||||
_continue = false;
|
||||
}
|
||||
catch (SecurityException e)
|
||||
{
|
||||
System.err.println(ServerReturnCodes.RC_SECURITY_ERROR);
|
||||
System.err.println(ServerReturnCodes.RC_SECURITY_ERROR + ':' + e.getMessage());
|
||||
_msg = ServerReturnCodes.RC_SECURITY_ERROR;
|
||||
_continue = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue