net.sourceforge.jtds.jdbc
Class SharedLocalNamedPipe
java.lang.Object
|
+--net.sourceforge.jtds.jdbc.SharedSocket
|
+--net.sourceforge.jtds.jdbc.SharedLocalNamedPipe
- public class SharedLocalNamedPipe
- extends SharedSocket
This class implements inter-process communication (IPC) to the database
server using local named pipes (will only work on Windows).
- Version:
- $Id: SharedLocalNamedPipe.java,v 1.6 2005/02/19 20:11:11 alin_sinpalean Exp $
- Author:
- Adam Etheredge
Field Summary |
(package private) java.io.RandomAccessFile |
pipe
The named pipe as a file. |
Fields inherited from class net.sourceforge.jtds.jdbc.SharedSocket |
cancelMonitor, cancelPending, charsetInfo, doneBuffer, globalMemUsage, hdrBuf, host, in, maxBufSize, memoryBudget, minMemPkts, out, packetCount, peakMemUsage, port, responseOwner, securityViolation, serverType, socket, socketTable, sslSocket, TDS_DONE_LEN, TDS_DONE_TOKEN, TDS_HDR_LEN, tdsVersion |
Constructor Summary |
SharedLocalNamedPipe(java.lang.String serverName,
int tdsVersion,
int serverType,
java.lang.String instance)
Creates a new instance of SharedLocalNamedPipe . |
Method Summary |
(package private) void |
close()
Close the named pipe and virtual sockets and release any resources. |
(package private) void |
forceClose()
Force close the socket causing any pending reads/writes to fail. |
(package private) boolean |
isConnected()
Get the connected status of this socket. |
(package private) byte[] |
sendNetPacket(int streamId,
byte[] buffer)
Send an network packet. |
protected void |
setTimeout(int timeout)
Set the socket timeout. |
Methods inherited from class net.sourceforge.jtds.jdbc.SharedSocket |
cancel, closeStream, dequeueInput, disableEncryption, enableEncryption, enqueueInput, getCharset, getCharsetInfo, getHost, getIn, getMemoryBudget, getMinMemPkts, getNetPacket, getOut, getPktLen, getPort, getRequestStream, getResponseStream, getServerType, getTdsVersion, lookup, readPacket, setCharsetInfo, setIn, setMemoryBudget, setMinMemPkts, setOut, setServerType, setTdsVersion |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
pipe
java.io.RandomAccessFile pipe
- The named pipe as a file.
SharedLocalNamedPipe
public SharedLocalNamedPipe(java.lang.String serverName,
int tdsVersion,
int serverType,
java.lang.String instance)
throws java.io.IOException
- Creates a new instance of
SharedLocalNamedPipe
.
- Parameters:
serverName
- name of the servertdsVersion
- the TDS protocol versionserverType
- the server type (SQL Server or Sybase)instance
- the database instance name- Throws:
java.io.IOException
- if an I/O error occurs
isConnected
boolean isConnected()
- Get the connected status of this socket.
- Overrides:
isConnected
in class SharedSocket
- Returns:
true
if the underlying named pipe is connected
sendNetPacket
byte[] sendNetPacket(int streamId,
byte[] buffer)
throws java.io.IOException
- Send an network packet. If output for another virtual socket is in
progress this packet will be sent later.
- Overrides:
sendNetPacket
in class SharedSocket
- Parameters:
streamId
- the originating RequestStream
objectbuffer
- the data to send- Throws:
java.io.IOException
- if an I/O error occurs
close
void close()
throws java.io.IOException
- Close the named pipe and virtual sockets and release any resources.
- Overrides:
close
in class SharedSocket
- Following copied from class:
net.sourceforge.jtds.jdbc.SharedSocket
- Throws:
java.io.IOException
- if the socket close fails
forceClose
void forceClose()
- Force close the socket causing any pending reads/writes to fail.
Used by the login timer to abort a login attempt.
- Overrides:
forceClose
in class SharedSocket
setTimeout
protected void setTimeout(int timeout)
- Set the socket timeout.
- Overrides:
setTimeout
in class SharedSocket
- Parameters:
timeout
- the timeout value in milliseconds
Generated on April 15 2005