|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jtds.jdbc.SharedSocket net.sourceforge.jtds.jdbc.SharedLocalNamedPipe
This class implements inter-process communication (IPC) to the database server using local named pipes (will only work on Windows).
Nested Class Summary | |
(package private) static class |
SharedSocket.VirtualSocket
This inner class contains the state information for the virtual socket. |
Field Summary | |
(package private) java.io.RandomAccessFile |
pipe
The named pipe as a file. |
protected int |
serverType
The servertype one of Driver.SQLSERVER or Driver.SYBASE |
Constructor Summary | |
SharedLocalNamedPipe(ConnectionJDBC2 connection)
Creates a new instance of SharedLocalNamedPipe . |
Method Summary | |
(package private) boolean |
cancel(SharedSocket.VirtualSocket vsock)
Send a TDS cancel packet to the server. |
(package private) void |
close()
Close the named pipe and virtual sockets and release any resources. |
(package private) void |
closeStream(SharedSocket.VirtualSocket vsock)
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()
Ensure all resources are released. |
(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.in field. |
(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(SharedSocket.VirtualSocket vsock,
byte[] buffer)
Get a network packet. |
protected java.io.DataOutputStream |
getOut()
Getter for SharedSocket.out field. |
(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(SharedSocket.VirtualSocket vsock,
byte[] buffer)
Send an 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.in field. |
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.out field. |
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 |
java.io.RandomAccessFile pipe
protected final int serverType
Constructor Detail |
public SharedLocalNamedPipe(ConnectionJDBC2 connection) throws java.io.IOException
SharedLocalNamedPipe
.
connection
- the connection object
java.io.IOException
- if an I/O error occursMethod Detail |
boolean isConnected()
isConnected
in class SharedSocket
true
if the underlying named pipe is connectedbyte[] sendNetPacket(SharedSocket.VirtualSocket vsock, byte[] buffer) throws java.io.IOException
sendNetPacket
in class SharedSocket
vsock
- the VirtualSocket
used by the originating RequestStream
buffer
- the data to send
java.io.IOException
- if an I/O error occursvoid close() throws java.io.IOException
close
in class SharedSocket
java.io.IOException
- if the socket close failsvoid forceClose()
Used by the login timer to abort a login attempt.
forceClose
in class SharedSocket
protected void setTimeout(int timeout)
setTimeout
in class SharedSocket
timeout
- the timeout value in millisecondsvoid enableEncryption(java.lang.String ssl) throws java.io.IOException
ssl
- the SSL URL property value
java.io.IOException
- if an I/O error occursvoid 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 RequestStream
maxPrecision
- the maximum precision for numeric/decimal types
RequestStream
ResponseStream getResponseStream(RequestStream requestStream, int bufferSize)
requestStream
- an existing server request stream object obtained
from this SharedSocket
bufferSize
- the initial buffer size to be used by the
RequestStream
ResponseStream
int getTdsVersion()
int
protected void setTdsVersion(int tdsVersion)
tdsVersion
- the TDS version as an int
static void setMemoryBudget(int memoryBudget)
memoryBudget
- the global memory budgetstatic int getMemoryBudget()
int
static void setMinMemPkts(int minMemPkts)
minMemPkts
- the minimum number of packets to cachestatic int getMinMemPkts()
int
boolean cancel(SharedSocket.VirtualSocket vsock)
vsock
- the SharedSocket.VirtualSocket
used by the request to be canceled
void closeStream(SharedSocket.VirtualSocket vsock)
vsock
- the SharedSocket.VirtualSocket
to closebyte[] getNetPacket(SharedSocket.VirtualSocket vsock, byte[] buffer) throws java.io.IOException
vsock
- SharedSocket.VirtualSocket
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.SocketException
protected 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()
String
protected 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 |