java.lang.Object
java.net.Socket
org.codelibs.jcifs.smb1.netbios.NbtSocket
- All Implemented Interfaces:
Closeable,AutoCloseable
Do not use this class. Writing to the OutputStream of this type of socket
requires leaving a 4 byte prefix for the NBT header. IOW you must call
write( buf, 4, len ). Calling write( buf, 0, len ) will generate an error.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an unconnected NbtSocket.NbtSocket(NbtAddress address, int port) Constructs an NbtSocket and connects it to the specified NetBIOS address and port.NbtSocket(NbtAddress address, int port, InetAddress localAddr, int localPort) Constructs an NbtSocket with specified local and remote addresses.NbtSocket(NbtAddress address, String calledName, int port, InetAddress localAddr, int localPort) Creates a new NetBIOS socket with the specified parameters. -
Method Summary
Methods inherited from class java.net.Socket
bind, connect, connect, getChannel, getInetAddress, getKeepAlive, getLocalSocketAddress, getOOBInline, getOption, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setOption, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, supportedOptions
-
Constructor Details
-
NbtSocket
public NbtSocket()Constructs an unconnected NbtSocket. -
NbtSocket
Constructs an NbtSocket and connects it to the specified NetBIOS address and port.- Parameters:
address- the NetBIOS address to connect toport- the port number, or 0 for the default NetBIOS session service port- Throws:
IOException- if an I/O error occurs while creating the socket
-
NbtSocket
public NbtSocket(NbtAddress address, int port, InetAddress localAddr, int localPort) throws IOException Constructs an NbtSocket with specified local and remote addresses.- Parameters:
address- the NetBIOS address to connect toport- the remote port number, or 0 for the default NetBIOS session service portlocalAddr- the local address to bind tolocalPort- the local port to bind to- Throws:
IOException- if an I/O error occurs while creating the socket
-
NbtSocket
public NbtSocket(NbtAddress address, String calledName, int port, InetAddress localAddr, int localPort) throws IOException Creates a new NetBIOS socket with the specified parameters.- Parameters:
address- the NetBIOS address to connect tocalledName- the called NetBIOS name (optional)port- the port number (0 for default)localAddr- the local address to bind tolocalPort- the local port to bind to- Throws:
IOException- if an I/O error occurs while creating the socket
-
-
Method Details
-
getNbtAddress
Returns the NetBIOS address associated with this socket.- Returns:
- the NetBIOS address
-
getInputStream
- Overrides:
getInputStreamin classSocket- Throws:
IOException
-
getOutputStream
- Overrides:
getOutputStreamin classSocket- Throws:
IOException
-
getPort
public int getPort() -
getLocalAddress
- Overrides:
getLocalAddressin classSocket
-
getLocalPort
public int getLocalPort()- Overrides:
getLocalPortin classSocket
-
toString
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classSocket- Throws:
IOException
-