Module jcifs

Class NbtSocket

java.lang.Object
java.net.Socket
org.codelibs.jcifs.smb1.netbios.NbtSocket
All Implemented Interfaces:
Closeable, AutoCloseable

public class NbtSocket extends Socket
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 Details

    • NbtSocket

      public NbtSocket()
      Constructs an unconnected NbtSocket.
    • NbtSocket

      public NbtSocket(NbtAddress address, int port) throws IOException
      Constructs an NbtSocket and connects it to the specified NetBIOS address and port.
      Parameters:
      address - the NetBIOS address to connect to
      port - 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 to
      port - the remote port number, or 0 for the default NetBIOS session service port
      localAddr - the local address to bind to
      localPort - 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 to
      calledName - the called NetBIOS name (optional)
      port - the port number (0 for default)
      localAddr - the local address to bind to
      localPort - the local port to bind to
      Throws:
      IOException - if an I/O error occurs while creating the socket
  • Method Details