VNCj

gnu.rfb.server
Class RFBSocket

java.lang.Object
  |
  +--gnu.rfb.server.RFBSocket
All Implemented Interfaces:
RFBClient, Runnable

public class RFBSocket
extends Object
implements RFBClient, Runnable

Standard RFB client model using a simple Socket.


Field Summary
private  RFBAuthenticator authenticator
           
private  Constructor constructor
           
private  Object[] constructorArgs
           
private  int[] encodings
           
private  RFBHost host
           
private  DataInputStream input
           
private  boolean isLocal
           
private  DataOutputStream output
           
private  PixelFormat pixelFormat
           
private  int preferredEncoding
           
private  String protocolVersionMsg
           
private  RFBServer server
           
private  boolean shared
           
private  Socket socket
           
 
Constructor Summary
RFBSocket(Socket socket, Constructor constructor, Object[] constructorArgs, RFBHost host, RFBAuthenticator authenticator)
           
 
Method Summary
 void close()
           
 void flush()
           
 int[] getEncodings()
           
 InetAddress getInetAddress()
           
 PixelFormat getPixelFormat()
           
 int getPreferredEncoding()
           
 String getProtocolVersionMsg()
           
 boolean getShared()
           
private  void initServer()
           
 void read(byte[] bytes)
           
private  void readClientCutText()
           
private  void readClientInit()
           
private  void readFixColourMapEntries()
           
private  void readFrameBufferUpdateRequest()
           
private  void readKeyEvent()
           
private  void readPointerEvent()
           
private  void readProtocolVersionMsg()
           
private  void readSetEncodings()
           
private  void readSetPixelFormat()
           
 void run()
           
 void setPreferredEncoding(int encoding)
           
 void write(byte[] bytes)
           
 void write(int integer)
           
 void writeBell()
           
 void writeConnectionFailed(String text)
           
 void writeFrameBufferUpdate(Rect[] rects)
           
private  void writeProtocolVersionMsg()
           
 void writeServerCutText(String text)
           
private  void writeServerInit()
           
private  void writeServerMessageType(int type)
           
 void writeSetColourMapEntries(int firstColour, Colour[] colours)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

socket

private Socket socket

isLocal

private boolean isLocal

constructor

private Constructor constructor

constructorArgs

private Object[] constructorArgs

host

private RFBHost host

authenticator

private RFBAuthenticator authenticator

server

private RFBServer server

input

private DataInputStream input

output

private DataOutputStream output

pixelFormat

private PixelFormat pixelFormat

protocolVersionMsg

private String protocolVersionMsg

shared

private boolean shared

encodings

private int[] encodings

preferredEncoding

private int preferredEncoding
Constructor Detail

RFBSocket

public RFBSocket(Socket socket,
                 Constructor constructor,
                 Object[] constructorArgs,
                 RFBHost host,
                 RFBAuthenticator authenticator)
          throws IOException
Method Detail

getPixelFormat

public PixelFormat getPixelFormat()
Specified by:
getPixelFormat in interface RFBClient

getProtocolVersionMsg

public String getProtocolVersionMsg()
Specified by:
getProtocolVersionMsg in interface RFBClient

getShared

public boolean getShared()
Specified by:
getShared in interface RFBClient

getPreferredEncoding

public int getPreferredEncoding()
Specified by:
getPreferredEncoding in interface RFBClient

setPreferredEncoding

public void setPreferredEncoding(int encoding)
Specified by:
setPreferredEncoding in interface RFBClient

getEncodings

public int[] getEncodings()
Specified by:
getEncodings in interface RFBClient

getInetAddress

public InetAddress getInetAddress()
Specified by:
getInetAddress in interface RFBClient

writeFrameBufferUpdate

public void writeFrameBufferUpdate(Rect[] rects)
                            throws IOException
Specified by:
writeFrameBufferUpdate in interface RFBClient
IOException

writeSetColourMapEntries

public void writeSetColourMapEntries(int firstColour,
                                     Colour[] colours)
                              throws IOException
Specified by:
writeSetColourMapEntries in interface RFBClient
IOException

writeBell

public void writeBell()
               throws IOException
Specified by:
writeBell in interface RFBClient
IOException

writeServerCutText

public void writeServerCutText(String text)
                        throws IOException
Specified by:
writeServerCutText in interface RFBClient
IOException

writeConnectionFailed

public void writeConnectionFailed(String text)
                           throws IOException
Specified by:
writeConnectionFailed in interface RFBClient
IOException

write

public void write(int integer)
           throws IOException
Specified by:
write in interface RFBClient
IOException

write

public void write(byte[] bytes)
           throws IOException
Specified by:
write in interface RFBClient
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface RFBClient
IOException

read

public void read(byte[] bytes)
          throws IOException
Specified by:
read in interface RFBClient
IOException

close

public void close()
           throws IOException
Specified by:
close in interface RFBClient
IOException

run

public void run()
Specified by:
run in interface Runnable

initServer

private void initServer()
                 throws IOException
IOException

writeProtocolVersionMsg

private void writeProtocolVersionMsg()
                              throws IOException
IOException

readProtocolVersionMsg

private void readProtocolVersionMsg()
                             throws IOException
IOException

readClientInit

private void readClientInit()
                     throws IOException
IOException

writeServerInit

private void writeServerInit()
                      throws IOException
IOException

writeServerMessageType

private void writeServerMessageType(int type)
                             throws IOException
IOException

readSetPixelFormat

private void readSetPixelFormat()
                         throws IOException
IOException

readFixColourMapEntries

private void readFixColourMapEntries()
                              throws IOException
IOException

readSetEncodings

private void readSetEncodings()
                       throws IOException
IOException

readFrameBufferUpdateRequest

private void readFrameBufferUpdateRequest()
                                   throws IOException
IOException

readKeyEvent

private void readKeyEvent()
                   throws IOException
IOException

readPointerEvent

private void readPointerEvent()
                       throws IOException
IOException

readClientCutText

private void readClientCutText()
                        throws IOException
IOException

VNCj