Package net.sourceforge.jtds.jdbc
Class SharedNamedPipe
- java.lang.Object
-
- net.sourceforge.jtds.jdbc.SharedSocket
-
- net.sourceforge.jtds.jdbc.SharedNamedPipe
-
public class SharedNamedPipe extends SharedSocket
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
SharedSocketand 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
Fields Modifier and Type Field Description private jcifs.smb.SmbNamedPipepipeThe shared named pipe.-
Fields inherited from class net.sourceforge.jtds.jdbc.SharedSocket
serverType
-
-
Constructor Summary
Constructors Constructor Description SharedNamedPipe(JtdsConnection connection)Creates a new instance ofSharedNamedPipe.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidclose()Close the socket (noop if in shared mode).(package private) voidforceClose()Force close the socket causing any pending reads/writes to fail.(package private) java.lang.StringgetMAC()private jcifs.smb.SmbNamedPipegetPipe()Getter forpipefield.(package private) booleanisConnected()Get the connected status of this socket.private voidsetPipe(jcifs.smb.SmbNamedPipe pipe)Setter forpipefield.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, sendNetPacket, setCharsetInfo, setIn, setKeepAlive, setMemoryBudget, setMinMemPkts, setOut, setTdsVersion
-
-
-
-
Constructor Detail
-
SharedNamedPipe
public SharedNamedPipe(JtdsConnection connection) throws java.io.IOException
Creates a new instance ofSharedNamedPipe.- Parameters:
connection-- Throws:
java.io.IOException- if the named pipe or its input or output streams do not openjava.net.UnknownHostException- if host cannot be found for the named pipe
-
-
Method Detail
-
getMAC
java.lang.String getMAC()
- Overrides:
getMACin classSharedSocket
-
isConnected
boolean isConnected()
Get the connected status of this socket.- Overrides:
isConnectedin classSharedSocket- Returns:
- true if the underlying socket is connected
-
close
void close() throws java.io.IOExceptionClose the socket (noop if in shared mode).- Overrides:
closein classSharedSocket- 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:
forceClosein classSharedSocket
-
getPipe
private jcifs.smb.SmbNamedPipe getPipe()
Getter forpipefield.- Returns:
SmbNamedPipeused for communication
-
setPipe
private void setPipe(jcifs.smb.SmbNamedPipe pipe)
Setter forpipefield.- Parameters:
pipe-SmbNamedPipeto 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:
setTimeoutin classSharedSocket- Parameters:
timeout- timeout value in milliseconds
-
-