public class NetBIOSSocket
extends java.lang.Object
Contains the details of a Winsock NetBIOS socket that was opened using native code.
| Modifier and Type | Field and Description |
|---|---|
static int |
SocketWouldBlock |
| Modifier and Type | Method and Description |
|---|---|
NetBIOSSocket |
accept()
Accept an incoming session connection and create a session socket for the new session.
|
int |
available()
Return the available data length for the socket
|
void |
closeSocket()
Close the socket
|
void |
configureBlocking(boolean nonBlocking)
Set this socket to use non-blocking I/O
|
static NetBIOSSocket |
connectSocket(int lana,
NetBIOSName remoteName)
Create a NetBIOS socket that is connected to a remote server/service
|
static NetBIOSSocket |
createListenerSocket(int lana,
NetBIOSName nbName)
Create a NetBIOS socket to listen for incoming sessions on the specified LANA
|
static NetBIOSSocket |
createListenerSocket(int lana,
NetBIOSName nbName,
boolean fastAddName)
Create a NetBIOS socket to listen for incoming sessions on the specified LANA
|
int |
getLana()
Return the NetBIOS LANA the socket is associated with
|
NetBIOSName |
getName()
Return the NetBIOS name.
|
int |
getSocket()
Return the socket pointer
|
int |
hashCode()
Return a hash code for the NetBIOS socket, using the socket id
|
boolean |
hasSocket()
Determine if the socket is valid
|
static void |
initializeSockets()
Initialize the Winsock NetBIOS interface
|
static boolean |
isInitialized()
Determine if the Winsock NetBIOS interface is initialized
|
boolean |
isListener()
Determine if this is a listener type socket
|
boolean |
isNonBlocking()
Check if this socket is in a non-blocking mode
|
int |
read(byte[] buf,
int off,
int maxLen)
Read data from the session socket
|
NetBIOSSelectionKey |
register(NetBIOSSelector selector,
int ops,
java.lang.Object attachment)
Register a non-blocking socket with a selector
|
static int |
SelectReceiveSockets(int sockCnt,
int[] sockList,
int[] sockEvent)
Wait for one or more asynchronous sockets to trigger a receive event
|
protected void |
setSocket(int sockPtr)
Set the socket pointer
|
static void |
shutdownSockets()
Shutdown the Winsock NetBIOS interface
|
java.lang.String |
toString()
Return the NetBIOS socket details as a string
|
int |
write(byte[] buf,
int off,
int len)
Write data to the session socket
|
public static final int SocketWouldBlock
public static final void initializeSockets()
throws WinsockNetBIOSException
WinsockNetBIOSExceptionpublic static final void shutdownSockets()
public static final boolean isInitialized()
public static final int SelectReceiveSockets(int sockCnt,
int[] sockList,
int[] sockEvent)
throws WinsockNetBIOSException
sockCnt - intsockList - int[]sockEvent - int[]WinsockNetBIOSExceptionpublic static final NetBIOSSocket createListenerSocket(int lana, NetBIOSName nbName) throws WinsockNetBIOSException, NetBIOSSocketException
lana - intnbName - NetBIOSNameNetBIOSSocketExceptionWinsockNetBIOSExceptionpublic static final NetBIOSSocket createListenerSocket(int lana, NetBIOSName nbName, boolean fastAddName) throws WinsockNetBIOSException, NetBIOSSocketException
lana - intnbName - NetBIOSNamefastAddName - booleanNetBIOSSocketExceptionWinsockNetBIOSExceptionpublic static final NetBIOSSocket connectSocket(int lana, NetBIOSName remoteName) throws WinsockNetBIOSException, NetBIOSSocketException
lana - intremoteName - NetBIOSNameNetBIOSSocketExceptionWinsockNetBIOSExceptionpublic final int getLana()
public final boolean isListener()
public final boolean hasSocket()
public final int getSocket()
public final NetBIOSName getName()
public final void configureBlocking(boolean nonBlocking)
throws WinsockNetBIOSException
nonBlocking - booleanWinsockNetBIOSExceptionpublic final int write(byte[] buf,
int off,
int len)
throws WinsockNetBIOSException
buf - byte[]off - intlen - intWinsockNetBIOSExceptionpublic final int available()
throws WinsockNetBIOSException
WinsockNetBIOSExceptionpublic final int read(byte[] buf,
int off,
int maxLen)
throws WinsockNetBIOSException
buf - byte[]off - intmaxLen - intWinsockNetBIOSExceptionpublic final NetBIOSSocket accept() throws WinsockNetBIOSException, NetBIOSSocketException
NetBIOSSocketExceptionwinsockNetBIOSExceptionWinsockNetBIOSExceptionpublic final void closeSocket()
public final boolean isNonBlocking()
protected final void setSocket(int sockPtr)
sockPtr - intpublic final NetBIOSSelectionKey register(NetBIOSSelector selector, int ops, java.lang.Object attachment) throws java.nio.channels.IllegalBlockingModeException, java.io.IOException
selector - NetBIOSSelectorops - intattachment - Objectjava.nio.channels.IllegalBlockingModeExceptionjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.