mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-05 20:57:40 +00:00
GUAC-746: Allow connection IDs to be sent during handshake.
This commit is contained in:
@@ -129,8 +129,13 @@ public class ConfiguredGuacamoleSocket implements GuacamoleSocket {
|
||||
GuacamoleReader reader = socket.getReader();
|
||||
GuacamoleWriter writer = socket.getWriter();
|
||||
|
||||
// Send protocol
|
||||
writer.writeInstruction(new GuacamoleInstruction("select", config.getProtocol()));
|
||||
// Get protocol / connection ID
|
||||
String select_arg = config.getConnectionID();
|
||||
if (select_arg == null)
|
||||
select_arg = config.getProtocol();
|
||||
|
||||
// Send requested protocol or connection ID
|
||||
writer.writeInstruction(new GuacamoleInstruction("select", select_arg));
|
||||
|
||||
// Wait for server args
|
||||
GuacamoleInstruction args = expect(reader, "args");
|
||||
|
@@ -42,6 +42,12 @@ public class GuacamoleConfiguration implements Serializable {
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* The ID of the connection being joined. If this value is present,
|
||||
* the protocol need not be specified.
|
||||
*/
|
||||
private String connectionID;
|
||||
|
||||
/**
|
||||
* The name of the protocol associated with this configuration.
|
||||
*/
|
||||
@@ -52,6 +58,28 @@ public class GuacamoleConfiguration implements Serializable {
|
||||
*/
|
||||
private Map<String, String> parameters = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* Returns the ID of the connection being joined, if any. If no connection
|
||||
* is being joined, this returns null, and the protocol must be set.
|
||||
*
|
||||
* @return The ID of the connection being joined, or null if no connection
|
||||
* is being joined.
|
||||
*/
|
||||
public String getConnectionID() {
|
||||
return connectionID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ID of the connection being joined, if any. If no connection
|
||||
* is being joined, this value must be omitted, and the protocol must be
|
||||
* set instead.
|
||||
*
|
||||
* @param connectionID The ID of the connection being joined.
|
||||
*/
|
||||
public void setConnectionID(String connectionID) {
|
||||
this.connectionID = connectionID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the protocol to be used.
|
||||
* @return The name of the protocol to be used.
|
||||
|
Reference in New Issue
Block a user