supportsLEDState(false), | supportsLEDState(false), | ||||
is(0), os(0), reader_(0), writer_(0), | is(0), os(0), reader_(0), writer_(0), | ||||
shared(false), | shared(false), | ||||
state_(RFBSTATE_UNINITIALISED), useProtocol3_3(false), | |||||
state_(RFBSTATE_UNINITIALISED), | |||||
pendingPFChange(false), preferredEncoding(encodingTight), | pendingPFChange(false), preferredEncoding(encodingTight), | ||||
compressLevel(2), qualityLevel(-1), | compressLevel(2), qualityLevel(-1), | ||||
formatChange(false), encodingChange(false), | formatChange(false), encodingChange(false), | ||||
state_ = RFBSTATE_INVALID; | state_ = RFBSTATE_INVALID; | ||||
throw Exception("Server gave unsupported RFB protocol version %d.%d", | throw Exception("Server gave unsupported RFB protocol version %d.%d", | ||||
server.majorVersion, server.minorVersion); | server.majorVersion, server.minorVersion); | ||||
} else if (useProtocol3_3 || server.beforeVersion(3,7)) { | |||||
} else if (server.beforeVersion(3,7)) { | |||||
server.setVersion(3,3); | server.setVersion(3,3); | ||||
} else if (server.afterVersion(3,8)) { | } else if (server.afterVersion(3,8)) { | ||||
server.setVersion(3,8); | server.setVersion(3,8); |
// server upon initialisation. | // server upon initialisation. | ||||
void setShared(bool s) { shared = s; } | void setShared(bool s) { shared = s; } | ||||
// setProtocol3_3 configures whether or not the CConnection should | |||||
// only ever support protocol version 3.3 | |||||
void setProtocol3_3(bool s) {useProtocol3_3 = s;} | |||||
// setFramebuffer configures the PixelBuffer that the CConnection | // setFramebuffer configures the PixelBuffer that the CConnection | ||||
// should render all pixel data in to. Note that the CConnection | // should render all pixel data in to. Note that the CConnection | ||||
// takes ownership of the PixelBuffer and it must not be deleted by | // takes ownership of the PixelBuffer and it must not be deleted by | ||||
CharArray serverName; | CharArray serverName; | ||||
bool useProtocol3_3; | |||||
bool pendingPFChange; | bool pendingPFChange; | ||||
rfb::PixelFormat pendingPF; | rfb::PixelFormat pendingPF; | ||||
super(); | super(); | ||||
csecurity = null; is = null; os = null; reader_ = null; writer_ = null; | csecurity = null; is = null; os = null; reader_ = null; writer_ = null; | ||||
shared = false; | shared = false; | ||||
state_ = RFBSTATE_UNINITIALISED; useProtocol3_3 = false; | |||||
state_ = RFBSTATE_UNINITIALISED; | |||||
framebuffer = null; decoder = new DecodeManager(this); | framebuffer = null; decoder = new DecodeManager(this); | ||||
security = new SecurityClient(); | security = new SecurityClient(); | ||||
} | } | ||||
// server upon initialisation. | // server upon initialisation. | ||||
public final void setShared(boolean s) { shared = s; } | public final void setShared(boolean s) { shared = s; } | ||||
// setProtocol3_3 configures whether or not the CConnection should | |||||
// only ever support protocol version 3.3 | |||||
public final void setProtocol3_3(boolean s) { useProtocol3_3 = s; } | |||||
// setStreams() sets the streams to be used for the connection. These must | // setStreams() sets the streams to be used for the connection. These must | ||||
// be set before initialiseProtocol() and processMsg() are called. The | // be set before initialiseProtocol() and processMsg() are called. The | ||||
// CSecurity object may call setStreams() again to provide alternative | // CSecurity object may call setStreams() again to provide alternative | ||||
vlog.error(msg); | vlog.error(msg); | ||||
state_ = RFBSTATE_INVALID; | state_ = RFBSTATE_INVALID; | ||||
throw new Exception(msg); | throw new Exception(msg); | ||||
} else if (useProtocol3_3 || cp.beforeVersion(3,7)) { | |||||
} else if (cp.beforeVersion(3,7)) { | |||||
cp.setVersion(3,3); | cp.setVersion(3,3); | ||||
} else if (cp.afterVersion(3,8)) { | } else if (cp.afterVersion(3,8)) { | ||||
cp.setVersion(3,8); | cp.setVersion(3,8); | ||||
private String serverName; | private String serverName; | ||||
private boolean useProtocol3_3; | |||||
protected ModifiablePixelBuffer framebuffer; | protected ModifiablePixelBuffer framebuffer; | ||||
private DecodeManager decoder; | private DecodeManager decoder; | ||||