mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
Use client information object to complete handshake.
This commit is contained in:
@@ -64,7 +64,8 @@ public class ConfiguredGuacamoleSocket implements GuacamoleSocket {
|
|||||||
/**
|
/**
|
||||||
* Creates a new ConfiguredGuacamoleSocket which uses the given
|
* Creates a new ConfiguredGuacamoleSocket which uses the given
|
||||||
* GuacamoleConfiguration to complete the initial protocol handshake over
|
* GuacamoleConfiguration to complete the initial protocol handshake over
|
||||||
* the given GuacamoleSocket.
|
* the given GuacamoleSocket. A default GuacamoleClientInformation object
|
||||||
|
* is used to provide basic client information.
|
||||||
*
|
*
|
||||||
* @param socket The GuacamoleSocket to wrap.
|
* @param socket The GuacamoleSocket to wrap.
|
||||||
* @param config The GuacamoleConfiguration to use to complete the initial
|
* @param config The GuacamoleConfiguration to use to complete the initial
|
||||||
@@ -74,6 +75,26 @@ public class ConfiguredGuacamoleSocket implements GuacamoleSocket {
|
|||||||
*/
|
*/
|
||||||
public ConfiguredGuacamoleSocket(GuacamoleSocket socket,
|
public ConfiguredGuacamoleSocket(GuacamoleSocket socket,
|
||||||
GuacamoleConfiguration config) throws GuacamoleException {
|
GuacamoleConfiguration config) throws GuacamoleException {
|
||||||
|
this(socket, config, new GuacamoleClientInformation());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new ConfiguredGuacamoleSocket which uses the given
|
||||||
|
* GuacamoleConfiguration and GuacamoleClientInformation to complete the
|
||||||
|
* initial protocol handshake over the given GuacamoleSocket.
|
||||||
|
*
|
||||||
|
* @param socket The GuacamoleSocket to wrap.
|
||||||
|
* @param config The GuacamoleConfiguration to use to complete the initial
|
||||||
|
* protocol handshake.
|
||||||
|
* @param info The GuacamoleClientInformation to use to complete the initial
|
||||||
|
* protocol handshake.
|
||||||
|
* @throws GuacamoleException If an error occurs while completing the
|
||||||
|
* initial protocol handshake.
|
||||||
|
*/
|
||||||
|
public ConfiguredGuacamoleSocket(GuacamoleSocket socket,
|
||||||
|
GuacamoleConfiguration config,
|
||||||
|
GuacamoleClientInformation info) throws GuacamoleException {
|
||||||
|
|
||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
|
|
||||||
@@ -109,6 +130,21 @@ public class ConfiguredGuacamoleSocket implements GuacamoleSocket {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Send size
|
||||||
|
writer.writeInstruction(
|
||||||
|
new GuacamoleInstruction(
|
||||||
|
Operation.CLIENT_SIZE,
|
||||||
|
Integer.toString(info.getOptimalScreenWidth()),
|
||||||
|
Integer.toString(info.getOptimalScreenHeight())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Send supported audio formats (STUB)
|
||||||
|
writer.writeInstruction(new GuacamoleInstruction(Operation.CLIENT_AUDIO));
|
||||||
|
|
||||||
|
// Send supported video formats (STUB)
|
||||||
|
writer.writeInstruction(new GuacamoleInstruction(Operation.CLIENT_VIDEO));
|
||||||
|
|
||||||
// Send args
|
// Send args
|
||||||
writer.writeInstruction(new GuacamoleInstruction(Operation.CLIENT_CONNECT, args));
|
writer.writeInstruction(new GuacamoleInstruction(Operation.CLIENT_CONNECT, args));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user