| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.jtds.jdbc.SharedSocket
net.sourceforge.jtds.jdbc.SharedNamedPipe
This class implements inter-process communication (IPC) to the database server using named pipes.
SharedSocket and this class., Implement connection timeouts for named pipes.| Field Summary | |
| private  jcifs.smb.SmbNamedPipe | pipeThe shared named pipe. | 
| protected  int | serverTypeThe servertype one of Driver.SQLSERVER or Driver.SYBASE | 
| Constructor Summary | |
| SharedNamedPipe(ConnectionJDBC2 connection)Creates a new instance of SharedNamedPipe. | |
| Method Summary | |
| (package private)  boolean | cancel(int streamId)Send a TDS cancel packet to the server. | 
| (package private)  void | close()Close the socket (noop if in shared mode). | 
| (package private)  void | closeStream(int streamId)Deallocate a stream linked to this socket. | 
| (package private)  void | disableEncryption()Disable TLS encryption and switch back to raw TCP/IP socket. | 
| (package private)  void | enableEncryption(java.lang.String ssl)Enable TLS encryption by creating a TLS socket over the existing TCP/IP network socket. | 
| protected  void | finalize()Finalize this object by releasing its resources. | 
| (package private)  void | forceClose()Force close the socket causing any pending reads/writes to fail. | 
| (package private)  java.lang.String | getCharset()Retrieve the character set name used to translate byte arrays to or from Strings. | 
| (package private)  CharsetInfo | getCharsetInfo()Retrieve the character set descriptor used to translate byte arrays to or from Strings. | 
| protected  java.lang.String | getHost()Get the server host name. | 
| protected  java.io.DataInputStream | getIn()Getter for SharedSocket.infield. | 
| (package private) static int | getMemoryBudget()Get the global buffer memory limit for all instancs of this driver. | 
| (package private) static int | getMinMemPkts()Get the minimum number of memory cached packets. | 
| (package private)  byte[] | getNetPacket(int streamId,
             byte[] buffer)Get a network packet. | 
| protected  java.io.DataOutputStream | getOut()Getter for SharedSocket.outfield. | 
| private  jcifs.smb.SmbNamedPipe | getPipe()Getter for pipefield. | 
| (package private) static int | getPktLen(byte[] buf)Convert two bytes (in network byte order) in a byte array into a Java short integer. | 
| protected  int | getPort()Get the server port number. | 
| (package private)  RequestStream | getRequestStream(int bufferSize,
                 int maxPrecision)Obtain an instance of a server request stream for this socket. | 
| (package private)  ResponseStream | getResponseStream(RequestStream requestStream,
                  int bufferSize)Obtain an instance of a server response stream for this socket. | 
| (package private)  int | getTdsVersion()Retrieve the TDS version that is active on the connection supported by this socket. | 
| (package private)  boolean | isConnected()Get the connected status of this socket. | 
| (package private)  byte[] | sendNetPacket(int streamId,
              byte[] buffer)Send a network packet. | 
| (package private)  void | setCharsetInfo(CharsetInfo charsetInfo)Set the character set descriptor to be used to translate byte arrays to or from Strings. | 
| protected  void | setIn(java.io.DataInputStream in)Setter for SharedSocket.infield. | 
| protected  void | setKeepAlive(boolean keepAlive)Set the socket keep alive. | 
| (package private) static void | setMemoryBudget(int memoryBudget)Set the global buffer memory limit for all instances of this driver. | 
| (package private) static void | setMinMemPkts(int minMemPkts)Set the minimum number of packets to cache in memory before writing to disk. | 
| protected  void | setOut(java.io.DataOutputStream out)Setter for SharedSocket.outfield. | 
| private  void | setPipe(jcifs.smb.SmbNamedPipe pipe)Setter for pipefield. | 
| protected  void | setTdsVersion(int tdsVersion)Set the TDS version field. | 
| protected  void | setTimeout(int timeout)Set the socket timeout. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
private jcifs.smb.SmbNamedPipe pipe
protected final int serverType
| Constructor Detail | 
public SharedNamedPipe(ConnectionJDBC2 connection)
                throws java.io.IOException
SharedNamedPipe.
connection - 
java.io.IOException - if the named pipe or its input or output streams do
                     not open
java.net.UnknownHostException - if host cannot be found for the named pipe| Method Detail | 
boolean isConnected()
isConnected in class SharedSocket
void close()
     throws java.io.IOException
close in class SharedSocketjava.io.IOException - if the socket close failsvoid forceClose()
forceClose in class SharedSocketprivate jcifs.smb.SmbNamedPipe getPipe()
pipe field.
SmbNamedPipe used for communicationprivate void setPipe(jcifs.smb.SmbNamedPipe pipe)
pipe field.
pipe - SmbNamedPipe to be used for communicationprotected void setTimeout(int timeout)
setTimeout in class SharedSockettimeout - timeout value in milliseconds
void enableEncryption(java.lang.String ssl)
                throws java.io.IOException
ssl - the SSL URL property value
java.io.IOException - if an I/O error occurs
void disableEncryption()
                 throws java.io.IOException
java.io.IOException - if an I/O error occursvoid setCharsetInfo(CharsetInfo charsetInfo)
charsetInfo - the character set descriptorCharsetInfo getCharsetInfo()
java.lang.String getCharset()
String
RequestStream getRequestStream(int bufferSize,
                               int maxPrecision)
bufferSize - the initial buffer size to be used by the
                   RequestStreammaxPrecision - the maximum precision for numeric/decimal types
RequestStream
ResponseStream getResponseStream(RequestStream requestStream,
                                 int bufferSize)
requestStream - an existing server request stream object obtained
                      from this SharedSocketbufferSize - the initial buffer size to be used by the
                      RequestStream
ResponseStreamint getTdsVersion()
intprotected void setTdsVersion(int tdsVersion)
tdsVersion - the TDS version as an intstatic void setMemoryBudget(int memoryBudget)
memoryBudget - the global memory budgetstatic int getMemoryBudget()
intstatic void setMinMemPkts(int minMemPkts)
minMemPkts - the minimum number of packets to cachestatic int getMinMemPkts()
intboolean cancel(int streamId)
streamId - the RequestStream id
boolean true if a cancel is actually
 issued by this method call.void closeStream(int streamId)
streamId - the ResponseStream id
byte[] sendNetPacket(int streamId,
                     byte[] buffer)
               throws java.io.IOException
streamId - the originating RequestStream objectbuffer - the data to send
java.io.IOException - if an I/O error occurs
byte[] getNetPacket(int streamId,
                    byte[] buffer)
              throws java.io.IOException
streamId - the originating ResponseStream objectbuffer - the data buffer to receive the object (may be replaced)
byte[] buffer
java.io.IOException - if an I/O error occursstatic int getPktLen(byte[] buf)
buf - array of data
int
protected void setKeepAlive(boolean keepAlive)
                     throws java.net.SocketException
keepAlive - true to turn on socket keep alive
java.net.SocketExceptionprotected java.io.DataInputStream getIn()
SharedSocket.in field.
InputStream used for communicationprotected void setIn(java.io.DataInputStream in)
SharedSocket.in field.
in - the InputStream to be used for communicationprotected java.io.DataOutputStream getOut()
SharedSocket.out field.
OutputStream used for communicationprotected void setOut(java.io.DataOutputStream out)
SharedSocket.out field.
out - the OutputStream to be used for communicationprotected java.lang.String getHost()
Stringprotected int getPort()
int
protected void finalize()
                 throws java.lang.Throwable
java.lang.Throwable| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||