|
|||||||||||
| 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.SharedLocalNamedPipe
This class implements inter-process communication (IPC) to the database server using local named pipes (will only work on Windows).
| 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(int streamId)
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(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.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(int streamId,
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(int streamId,
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 occurs| Method Detail |
boolean isConnected()
isConnected in class SharedSockettrue if the underlying named pipe is connected
byte[] sendNetPacket(int streamId,
byte[] buffer)
throws java.io.IOException
sendNetPacket in class SharedSocketstreamId - the originating RequestStream objectbuffer - the data to send
java.io.IOException - if an I/O error occurs
void close()
throws java.io.IOException
close in class SharedSocketjava.io.IOException - if the socket close failsvoid forceClose()
Used by the login timer to abort a login attempt.
forceClose in class SharedSocketprotected void setTimeout(int timeout)
setTimeout in class SharedSockettimeout - the 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[] 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 | ||||||||||