Learn how to evaluate and integrate the VNC SDK
Server¶
-
public final class
Server
¶ A VNC-compatible Server enabling a computer to be remotely controlled.
Nested Classes¶
- interface
Server.AgentCallback
- enum
Server.CaptureMethod
- interface
Server.ConnectionCallback
- enum
Server.DisconnectFlags
- enum
Server.EncryptionLevel
- interface
Server.InputEventsCallback
- enum
Server.Permissions
- interface
Server.SecurityCallback
Constructor Summary¶
Method Summary¶
Modifier and Type | Method and Description |
---|---|
void |
Destroys the Server. |
void |
Disconnects a particular Viewer, optionally specifying a message. |
void |
Disconnects all Viewers, optionally specifying a message. |
void |
Enables transmission of audio from the Server to the Viewer. |
AnnotationManager |
Obtains the Server’s |
int |
Returns the total number of Viewers currently connected to the Server. |
ConnectionHandler |
Obtains the Server’s |
DisplayManager |
Obtains the Server’s |
EncryptionLevel |
Returns the encryption level being used with an incoming connection, or the Server’s current encryption level if the connection is |
int |
Gets the current number of seconds to wait before disconnecting idle Viewers. |
MessagingManager |
Obtains the Server’s |
String |
Returns the address of a particular connected Viewer. |
java.util.EnumSet |
Gets the set of current permissions for a Viewer. |
boolean |
Determines if the |
void |
Sets agent-related callbacks for the Server. |
void |
Specifies a blacklist threshold and timeout for the Server. |
void |
Specifies the screen capture method used by the Server. |
void |
Sets connection-related callbacks for the Server. |
void |
Sets the desired encryption level of the session from the range of options enumerated by |
void |
Specifies a friendly name for the Server, to send to connected Viewers. |
void |
Sets the number of seconds to wait before disconnecting idle Viewers. |
void |
Sets input control related callbacks for the Server. |
void |
Changes permissions for a Viewer mid-session. |
void |
Sets security-related callbacks for the Server. |
void |
Set a password for use with third-party VNC Viewers, using VncAuth authentication. |
Constructors¶
-
public
Server
(String agentPath, boolean isService) throws Library.VncException¶ Creates a Server, optionally specifying whether to run as a service.
This constructor should not be used on Android.
Parameters: - agentPath – The full path to the
vncagent
executable, or null to specify thatvncagent
is in the same directory as the app binary at run-time. If you provide a directory, the executable must be calledvncagent
(vncagent.exe
on Windows); if you have renamedvncagent
then the filename must be provided. - isService – Whether to run as a service.
- agentPath – The full path to the
-
public
Server
(String agentPath) throws Library.VncException¶ Creates a Server.
This constructor should not be used on Android.
Parameters: - agentPath – The full path to the
vncagent
executable (seeServer(String, boolean)
for details).
- agentPath – The full path to the
-
public
Server
(android.content.Context context, android.media.projection.MediaProjection mediaProjection) throws Library.VncException¶ Creates a Server for Android.
Parameters: - context – The application context.
- mediaProjection – An
android.media.projection.MediaProjection
object.
The
android.media.projection.MediaProjection
object must be obtained fromandroid.media.projection.MediaProjectionManager
- see the Android documentation or sample code for more details on how to do this.
Methods¶
-
public void
destroy
()¶ Destroys the Server.
For more information, see
vnc_Server_destroy()
.
-
public void
disconnect
(Connection connection, String message, java.lang.Iterable<DisconnectFlags> flags)¶ Disconnects a particular Viewer, optionally specifying a message.
For more information, see
vnc_Server_disconnect()
.
-
public void
disconnectAll
(String message, java.lang.Iterable<DisconnectFlags> flags)¶ Disconnects all Viewers, optionally specifying a message.
For more information, see
vnc_Server_disconnectAll()
.
-
public void
enableAudio
(boolean enable) throws Library.VncException¶ Enables transmission of audio from the Server to the Viewer.
For more information, see
vnc_Server_enableAudio()
.
-
public AnnotationManager
getAnnotationManager
() throws Library.VncException¶ Obtains the Server’s
AnnotationManager
for handling annotation operations.
-
public int
getConnectionCount
()¶ Returns the total number of Viewers currently connected to the Server.
For more information, see
vnc_Server_getConnectionCount()
.
-
public ConnectionHandler
getConnectionHandler
() throws Library.VncException¶ Obtains the Server’s
ConnectionHandler
for performing connection operations.
-
public DisplayManager
getDisplayManager
() throws Library.VncException¶ Obtains the Server’s
DisplayManager
, for managing the list of displays made available by the Server and for setting the Server’s capture method.
-
public EncryptionLevel
getEncryptionLevel
(Connection connection)¶ Returns the encryption level being used with an incoming connection, or the Server’s current encryption level if the connection is
null
.For more information, see
vnc_Server_getEncryptionLevel()
.
-
public int
getIdleTimeout
()¶ Gets the current number of seconds to wait before disconnecting idle Viewers.
For more information, see
vnc_Server_getIdleTimeout()
.
-
public MessagingManager
getMessagingManager
() throws Library.VncException¶ Obtains the Server’s
MessagingManager
for handling messaging.
-
public String
getPeerAddress
(Connection connection) throws Library.VncException¶ Returns the address of a particular connected Viewer.
For more information, see
vnc_Server_getPeerAddress()
.
-
public java.util.EnumSet<Permissions>
getPermissions
(Connection connection) throws Library.VncException¶ Gets the set of current permissions for a Viewer.
For more information, see
vnc_Server_getPermissions()
.
-
public boolean
isAgentReady
()¶ Determines if the
vncagent
process is ready and available to capture the display and inject input events.For more information, see
vnc_Server_isAgentReady()
.
-
public void
setAgentCallback
(Server.AgentCallback callback) throws Library.VncException¶ Sets agent-related callbacks for the Server.
For more information, see
vnc_Server_setAgentCallback()
.
-
public void
setBlacklist
(int threshold, int timeout) throws Library.VncException¶ Specifies a blacklist threshold and timeout for the Server.
For more information, see
vnc_Server_setBlacklist()
.
-
public void
setCaptureMethod
(CaptureMethod captureMethod) throws Library.VncException¶ Specifies the screen capture method used by the Server.
For more information, see
vnc_Server_setCaptureMethod()
.
-
public void
setConnectionCallback
(Server.ConnectionCallback callback) throws Library.VncException¶ Sets connection-related callbacks for the Server.
For more information, see
vnc_Server_setConnectionCallback()
.
-
public void
setEncryptionLevel
(EncryptionLevel level) throws Library.VncException¶ Sets the desired encryption level of the session from the range of options enumerated by
ENCRYPTION_LEVEL
.For more information, see
vnc_Server_setEncryptionLevel()
.
-
public void
setFriendlyName
(String name)¶ Specifies a friendly name for the Server, to send to connected Viewers.
For more information, see
vnc_Server_setFriendlyName()
.
-
public void
setIdleTimeout
(int idleTimeout) throws Library.VncException¶ Sets the number of seconds to wait before disconnecting idle Viewers.
For more information, see
vnc_Server_setIdleTimeout()
.
-
public void
setInputEventsCallback
(Server.InputEventsCallback callback) throws Library.VncException¶ Sets input control related callbacks for the Server.
For more information, see
vnc_Server_setInputEventsCallback()
.
-
public void
setPermissions
(Connection connection, java.lang.Iterable<Permissions> perms) throws Library.VncException¶ Changes permissions for a Viewer mid-session.
For more information, see
vnc_Server_setPermissions()
.
-
public void
setSecurityCallback
(Server.SecurityCallback callback) throws Library.VncException¶ Sets security-related callbacks for the Server.
For more information, see
vnc_Server_setSecurityCallback()
.
-
public void
setVncAuthPassword
(String password) throws Library.VncException¶ Set a password for use with third-party VNC Viewers, using VncAuth authentication.
For more information, see
vnc_Server_setVncAuthPassword()
.