Package net.sourceforge.jtds.jdbc
Class SharedNamedPipe
java.lang.Object
net.sourceforge.jtds.jdbc.SharedSocket
net.sourceforge.jtds.jdbc.SharedNamedPipe
This class implements inter-process communication (IPC) to the
database server using named pipes.
- Version:
- $Id: SharedNamedPipe.java,v 1.19.2.2 2009-12-10 09:54:04 ickzon Exp $
- Author:
- David D. Kilzer
- To do:
- Extract abstract base class SharedIpc from
SharedSocket
and this class., Implement connection timeouts for named pipes.
-
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
ConstructorsConstructorDescriptionSharedNamedPipe
(JtdsConnection connection) Creates a new instance ofSharedNamedPipe
. -
Method Summary
Modifier and TypeMethodDescription(package private) void
close()
Close the socket (noop if in shared mode).(package private) void
Force close the socket causing any pending reads/writes to fail.(package private) String
getMAC()
private jcifs.smb.SmbNamedPipe
getPipe()
Getter forpipe
field.(package private) boolean
Get the connected status of this socket.private void
setPipe
(jcifs.smb.SmbNamedPipe pipe) Setter forpipe
field.protected void
setTimeout
(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, sendNetPacket, setCharsetInfo, setIn, setKeepAlive, setMemoryBudget, setMinMemPkts, setOut, setTdsVersion
-
Field Details
-
pipe
private jcifs.smb.SmbNamedPipe pipeThe shared named pipe.
-
-
Constructor Details
-
SharedNamedPipe
Creates a new instance ofSharedNamedPipe
.- Parameters:
connection
-- Throws:
IOException
- if the named pipe or its input or output streams do not openUnknownHostException
- if host cannot be found for the named pipe
-
-
Method Details
-
getMAC
String getMAC()- Overrides:
getMAC
in classSharedSocket
-
isConnected
boolean isConnected()Get the connected status of this socket.- Overrides:
isConnected
in classSharedSocket
- Returns:
- true if the underlying socket is connected
-
close
Close the socket (noop if in shared mode).- Overrides:
close
in 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:
forceClose
in classSharedSocket
-
getPipe
private jcifs.smb.SmbNamedPipe getPipe()Getter forpipe
field.- Returns:
SmbNamedPipe
used for communication
-
setPipe
private void setPipe(jcifs.smb.SmbNamedPipe pipe) Setter forpipe
field.- Parameters:
pipe
-SmbNamedPipe
to be used for communication
-
setTimeout
protected void setTimeout(int timeout) Set the socket timeout. Noop for now; timeouts are not implemented for SMB named pipes.- Overrides:
setTimeout
in classSharedSocket
- Parameters:
timeout
- timeout value in milliseconds
-