Send a Object Explorer session disconnect message on socket exceptions (#739)

* WIP

* WIP 2

* Send disconnect message o binding exception

* Add a try catch around the binding queue error handler
This commit is contained in:
Karl Burtram
2018-11-16 12:07:05 -08:00
committed by GitHub
parent 7f28f249de
commit 3c915a92f6
5 changed files with 124 additions and 36 deletions

View File

@@ -39,6 +39,29 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Contracts
public string SessionId { get; set; }
}
/// <summary>
/// Information returned when a session is disconnected.
/// Contains success information and a <see cref="SessionId"/>
/// </summary>
public class SessionDisconnectedParameters
{
/// <summary>
/// Boolean indicating if the connection was successful
/// </summary>
public bool Success { get; set; }
/// <summary>
/// Unique ID to use when sending any requests for objects in the
/// tree under the node
/// </summary>
public string SessionId { get; set; }
/// <summary>
/// Error message returned from the engine for a object explorer session failure reason, if any.
/// </summary>
public string ErrorMessage { get; set; }
}
/// <summary>
/// Establishes an Object Explorer tree session for a specific connection.
/// This will create a connection to a specific server or database, register
@@ -50,4 +73,14 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Contracts
RequestType<CloseSessionParams, CloseSessionResponse> Type =
RequestType<CloseSessionParams, CloseSessionResponse>.Create("objectexplorer/closesession");
}
/// <summary>
/// Session disconnected notification
/// </summary>
public class SessionDisconnectedNotification
{
public static readonly
EventType<SessionDisconnectedParameters> Type =
EventType<SessionDisconnectedParameters>.Create("objectexplorer/sessiondisconnected");
}
}