Package net.sourceforge.jtds.jdbc
Class SharedLocalNamedPipe
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).
- Version:
- $Id: SharedLocalNamedPipe.java,v 1.12 2007-07-08 21:38:13 bheineman Exp $
- Author:
- Adam Etheredge
-
Nested Class Summary
Nested classes/interfaces inherited from class net.sourceforge.jtds.jdbc.SharedSocket
SharedSocket.VirtualSocket -
Field Summary
FieldsFields inherited from class net.sourceforge.jtds.jdbc.SharedSocket
serverType -
Constructor Summary
ConstructorsConstructorDescriptionSharedLocalNamedPipe(JtdsConnection connection) Creates a new instance ofSharedLocalNamedPipe. -
Method Summary
Modifier and TypeMethodDescription(package private) voidclose()Close the named pipe and virtual sockets and release any resources.(package private) voidForce close the socket causing any pending reads/writes to fail.(package private) StringgetMAC()(package private) booleanGet the connected status of this socket.(package private) byte[]sendNetPacket(SharedSocket.VirtualSocket vsock, byte[] buffer) Send an network packet.protected voidsetTimeout(int timeout) Set the socket timeout.Methods inherited from class net.sourceforge.jtds.jdbc.SharedSocket
cancel, closeStream, disableEncryption, enableEncryption, finalize, getCharset, getCharsetInfo, getHost, getIn, getMemoryBudget, getMinMemPkts, getNetPacket, getOut, getPktLen, getPort, getRequestStream, getResponseStream, getTdsVersion, setCharsetInfo, setIn, setKeepAlive, setMemoryBudget, setMinMemPkts, setOut, setTdsVersion
-
Field Details
-
pipe
RandomAccessFile pipeThe named pipe as a file.
-
-
Constructor Details
-
SharedLocalNamedPipe
Creates a new instance ofSharedLocalNamedPipe.- Parameters:
connection- the connection object- Throws:
IOException- if an I/O error occurs
-
-
Method Details
-
getMAC
String getMAC()- Overrides:
getMACin classSharedSocket
-
isConnected
boolean isConnected()Get the connected status of this socket.- Overrides:
isConnectedin classSharedSocket- Returns:
trueif the underlying named pipe is connected
-
close
Close the named pipe and virtual sockets and release any resources.- Overrides:
closein classSharedSocket- Throws:
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:
forceClosein classSharedSocket
-
setTimeout
protected void setTimeout(int timeout) Set the socket timeout.- Overrides:
setTimeoutin classSharedSocket- Parameters:
timeout- the timeout value in milliseconds
-