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
WinsockNetBIOSException
public 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[]WinsockNetBIOSException
public static final NetBIOSSocket createListenerSocket(int lana, NetBIOSName nbName) throws WinsockNetBIOSException, NetBIOSSocketException
lana
- intnbName
- NetBIOSNameNetBIOSSocketException
WinsockNetBIOSException
public static final NetBIOSSocket createListenerSocket(int lana, NetBIOSName nbName, boolean fastAddName) throws WinsockNetBIOSException, NetBIOSSocketException
lana
- intnbName
- NetBIOSNamefastAddName
- booleanNetBIOSSocketException
WinsockNetBIOSException
public static final NetBIOSSocket connectSocket(int lana, NetBIOSName remoteName) throws WinsockNetBIOSException, NetBIOSSocketException
lana
- intremoteName
- NetBIOSNameNetBIOSSocketException
WinsockNetBIOSException
public 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
- booleanWinsockNetBIOSException
public final int write(byte[] buf, int off, int len) throws WinsockNetBIOSException
buf
- byte[]off
- intlen
- intWinsockNetBIOSException
public final int available() throws WinsockNetBIOSException
WinsockNetBIOSException
public final int read(byte[] buf, int off, int maxLen) throws WinsockNetBIOSException
buf
- byte[]off
- intmaxLen
- intWinsockNetBIOSException
public final NetBIOSSocket accept() throws WinsockNetBIOSException, NetBIOSSocketException
NetBIOSSocketException
winsockNetBIOSException
WinsockNetBIOSException
public 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.IllegalBlockingModeException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.