net.sourceforge.jtds.jdbc

Class 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 2007/07/12 20:34:47 bheineman 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

private SmbNamedPipe
pipe
The shared named pipe.

Fields inherited from class net.sourceforge.jtds.jdbc.SharedSocket

TDS_DONE_LEN, TDS_DONE_TOKEN, TDS_HDR_LEN, bufferDir, cancelMonitor, cancelPending, charsetInfo, doneBuffer, globalMemUsage, hdrBuf, host, in, maxBufSize, memoryBudget, minMemPkts, out, packetCount, peakMemUsage, port, responseOwner, securityViolation, serverType, socket, socketTable, sslSocket, tdsVersion

Constructor Summary

SharedNamedPipe(ConnectionJDBC2 connection)
Creates a new instance of SharedNamedPipe.

Method Summary

(package private) void
close()
Close the socket (noop if in shared mode).
(package private) void
forceClose()
Force close the socket causing any pending reads/writes to fail.
private SmbNamedPipe
getPipe()
Getter for pipe field.
(package private) boolean
isConnected()
Get the connected status of this socket.
private void
setPipe(SmbNamedPipe pipe)
Setter for pipe field.
protected void
setTimeout(int timeout)
Set the socket timeout.

Methods inherited from class net.sourceforge.jtds.jdbc.SharedSocket

cancel, close, closeStream, createSocketForJDBC3, dequeueInput, disableEncryption, enableEncryption, enqueueInput, forceClose, getCharset, getCharsetInfo, getHost, getIn, getMemoryBudget, getMinMemPkts, getNetPacket, getOut, getPktLen, getPort, getRequestStream, getResponseStream, getTdsVersion, isConnected, lookup, readPacket, sendNetPacket, setCharsetInfo, setIn, setMemoryBudget, setMinMemPkts, setOut, setTdsVersion, setTimeout

Field Details

pipe

private SmbNamedPipe pipe
The shared named pipe.

Constructor Details

SharedNamedPipe

public SharedNamedPipe(ConnectionJDBC2 connection)
            throws IOException
Creates a new instance of SharedNamedPipe.
Parameters:
connection -

Method Details

close

(package private)  void close()
            throws IOException
Close the socket (noop if in shared mode).
Overrides:
close in interface SharedSocket

forceClose

(package private)  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 interface SharedSocket

getPipe

private SmbNamedPipe getPipe()
Returns:
SmbNamedPipe used for communication

isConnected

(package private)  boolean isConnected()
Get the connected status of this socket.
Overrides:
isConnected in interface SharedSocket
Returns:
true if the underlying socket is connected

setPipe

private void setPipe(SmbNamedPipe pipe)
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 interface SharedSocket
Parameters:
timeout - timeout value in milliseconds

Generated on June 12 2008