gnu.rfb.server
Class RFBSocket

java.lang.Object
  extended by gnu.rfb.server.RFBSocket
All Implemented Interfaces:
RFBClient, java.lang.Runnable

public class RFBSocket
extends java.lang.Object
implements RFBClient, java.lang.Runnable


Constructor Summary
RFBSocket(java.net.Socket socket, RFBServer server, RFBHost host, RFBAuthenticator authenticator)
          new constructor by Marcus Wolschon
RFBSocket(java.net.Socket socket, RFBServer server, RFBHost host, RFBAuthenticator authenticator, boolean syncronous)
          new constructor by Marcus Wolschon
 
Method Summary
 void close()
          Closes the connection to the client.
 int[] getEncodings()
           
 java.net.InetAddress getInetAddress()
           
 java.lang.String getName()
           
 PixelFormat getPixelFormat()
           
 int getPreferredEncoding()
           
 java.lang.String getProtocolVersionMsg()
           
 boolean getShared()
           
 boolean getUpdateIsAvailable()
           
 void run()
           
 void setPreferredEncoding(int encoding)
           
 void setUpdateIsAvailable(boolean value)
          Set whether or not an update is available to send.
 void writeBell()
          Writes the bell message to the client.
 void writeFrameBufferUpdate(Rect[] rects)
          Writes the frame buffer update out to the client.
 void writeServerCutText(java.lang.String text)
          Writes a server cut text message to the client.
 void writeSetColourMapEntries(int firstColour, Colour[] colours)
          Writes the color map entries to the client.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RFBSocket

public RFBSocket(java.net.Socket socket,
                 RFBServer server,
                 RFBHost host,
                 RFBAuthenticator authenticator)
          throws java.io.IOException
new constructor by Marcus Wolschon

Throws:
java.io.IOException

RFBSocket

public RFBSocket(java.net.Socket socket,
                 RFBServer server,
                 RFBHost host,
                 RFBAuthenticator authenticator,
                 boolean syncronous)
          throws java.io.IOException
new constructor by Marcus Wolschon

Throws:
java.io.IOException
Method Detail

getPixelFormat

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

getProtocolVersionMsg

public java.lang.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

writeFrameBufferUpdate

public void writeFrameBufferUpdate(Rect[] rects)
                            throws java.io.IOException
Writes the frame buffer update out to the client.

Specified by:
writeFrameBufferUpdate in interface RFBClient
Parameters:
rects - An array of rectangles to write.
Throws:
java.io.IOException

writeSetColourMapEntries

public void writeSetColourMapEntries(int firstColour,
                                     Colour[] colours)
                              throws java.io.IOException
Writes the color map entries to the client.

Specified by:
writeSetColourMapEntries in interface RFBClient
Parameters:
firstColour -
colours -
Throws:
java.io.IOException - if unable to write the entries to the client.

writeBell

public void writeBell()
               throws java.io.IOException
Writes the bell message to the client.

Specified by:
writeBell in interface RFBClient
Throws:
java.io.IOException - If unable to write the message to the client.

writeServerCutText

public void writeServerCutText(java.lang.String text)
                        throws java.io.IOException
Writes a server cut text message to the client.

Specified by:
writeServerCutText in interface RFBClient
Throws:
java.io.IOException

close

public void close()
Closes the connection to the client.

Specified by:
close in interface RFBClient

run

public void run()
Specified by:
run in interface java.lang.Runnable

getInetAddress

public java.net.InetAddress getInetAddress()
Returns:
The InetAddress of the client.

getName

public java.lang.String getName()
Returns:
The name of the host as a String.

setUpdateIsAvailable

public void setUpdateIsAvailable(boolean value)
Set whether or not an update is available to send.

Specified by:
setUpdateIsAvailable in interface RFBClient

getUpdateIsAvailable

public boolean getUpdateIsAvailable()
Returns:
Whether or not an update is available to send.