Java Doc for NonblockingDatagramSocket.java in  » Web-Server » Rimfaxe-Web-Server » seda » nbio » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » Rimfaxe Web Server » seda.nbio 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.net.DatagramSocket
      seda.nbio.NonblockingDatagramSocket

All known Subclasses:   seda.nbio.NonblockingMulticastSocket,
NonblockingDatagramSocket
public class NonblockingDatagramSocket extends DatagramSocket implements Selectable(Code)
A NonblockingDatagramSocket provides non-blocking UDP (datagram) I/O.


Field Summary
 NonblockingSocketImplimpl
    
 booleanis_connected
    

Constructor Summary
public  NonblockingDatagramSocket()
     Create a NonblockingDatagramSocket bound to any available port.
public  NonblockingDatagramSocket(int port)
     Create a NonblockingDatagramSocket bound to the given port.
public  NonblockingDatagramSocket(int port, InetAddress laddr)
     Create a NonblockingDatagramSocket bound to the given port and the given local address.

Method Summary
public synchronized  voidclose()
     Close this NonblockingDatagramSocket.
public  voidconnect(InetAddress address, int port)
     Connect this NonblockingDatagramSocket to the given address and port.
public  voidconnect(String host, int port)
    
public synchronized  voiddisconnect()
    
public  InetAddressgetInetAddress()
     Return the remote address to which this socket is bound.
public  InetAddressgetLocalAddress()
     Return the local address to which this socket is bound.
public  intgetLocalPort()
     Return the local port to which this socket is bound.
public  intgetPort()
     Return the remote port to which this socket is bound.
public  intgetReceiveBufferSize()
    
public  intgetSendBufferSize()
    
public  intnbReceive(DatagramPacket p)
     Receive a datagram from this socket.
public  intnbReceive(byte[] data, int offset, int length)
     Receive a datagram from this socket.
public  intnbSend(DatagramPacket p)
     Sends a datagram packet from this socket.
public  intnbSend(byte[] data, int offset, int length, InetAddress addr, int port)
     Sends a datagram packet from this socket.
public  intnbSend(byte[] data, int offset, int length)
     Sends a datagram packet from this socket.
public  voidreceive(DatagramPacket p)
     This method is provided for convenience and mimics blocking behavior by invoking the nonblocking nbReceive() operation.
public  voidsend(DatagramPacket p)
     This method is provided for convenience and mimics blocking behavior by invoking the nonblocking nbSend() operation.
public  voidsetReceiveBufferSize(int size)
    
public  voidsetSendBufferSize(int size)
    

Field Detail
impl
NonblockingSocketImpl impl(Code)



is_connected
boolean is_connected(Code)




Constructor Detail
NonblockingDatagramSocket
public NonblockingDatagramSocket() throws IOException(Code)
Create a NonblockingDatagramSocket bound to any available port.



NonblockingDatagramSocket
public NonblockingDatagramSocket(int port) throws IOException(Code)
Create a NonblockingDatagramSocket bound to the given port.



NonblockingDatagramSocket
public NonblockingDatagramSocket(int port, InetAddress laddr) throws IOException(Code)
Create a NonblockingDatagramSocket bound to the given port and the given local address.




Method Detail
close
public synchronized void close()(Code)
Close this NonblockingDatagramSocket.



connect
public void connect(InetAddress address, int port) throws IllegalArgumentException(Code)
Connect this NonblockingDatagramSocket to the given address and port. All send() operations with a NULL 'sendTo' address will now send to this address by default. You may call connect() multiple times on a NonblockingDatagramSocket to change the default send address.



connect
public void connect(String host, int port) throws UnknownHostException(Code)



disconnect
public synchronized void disconnect()(Code)



getInetAddress
public InetAddress getInetAddress()(Code)
Return the remote address to which this socket is bound. Should be null if the socket hasn't been connected to anything.



getLocalAddress
public InetAddress getLocalAddress()(Code)
Return the local address to which this socket is bound.



getLocalPort
public int getLocalPort()(Code)
Return the local port to which this socket is bound.



getPort
public int getPort()(Code)
Return the remote port to which this socket is bound.



getReceiveBufferSize
public int getReceiveBufferSize() throws SocketException(Code)



getSendBufferSize
public int getSendBufferSize() throws SocketException(Code)



nbReceive
public int nbReceive(DatagramPacket p) throws IOException(Code)
Receive a datagram from this socket. When this method returns, the DatagramPacket's buffer is filled with the data received. The datagram packet also contains the sender's IP address, and the port number on the sender's machine. This method does not block if a datagram is not ready to be received. The length field of the datagram packet object contains the length of the received message, or is set to 0 if no packet was received. If the message is longer than the packet's length, the message is truncated. The size of the received packet, or 0 if no data was received.



nbReceive
public int nbReceive(byte[] data, int offset, int length) throws IOException(Code)
Receive a datagram from this socket. When this method returns, the given byte array is filled with the data received starting at the given offset with the given length. If the message is longer than the given length, the message is truncated. This method does not block if a datagram is not ready to be received. The size of the received packet, or 0 if no data was received.



nbSend
public int nbSend(DatagramPacket p) throws IOException(Code)
Sends a datagram packet from this socket. The DatagramPacket includes information indicating the data to be sent, its length, the IP address of the remote host, and the port number on the remote host. This method does not block; it returns 0 if the packet could not be sent. The amount of data sent, or 0 if the packet could not be sentimmediately.



nbSend
public int nbSend(byte[] data, int offset, int length, InetAddress addr, int port) throws IOException(Code)
Sends a datagram packet from this socket. This method constructs a temporary DatagramPacket from the given data, offset, length, address, and port, and calls nbSend(DatagramPacket p). This method does not block; it returns 0 if the packet could not be sent. The amount of data sent, or 0 if the packet could not be sentimmediately.



nbSend
public int nbSend(byte[] data, int offset, int length) throws IOException(Code)
Sends a datagram packet from this socket. This method constructs a temporary DatagramPacket from the given data, offset, and length. This method may only be called on a connected socket; if called on an unconnected socket, an IllegalArgumentException is thrown. This method does not block; it returns 0 if the packet could not be sent. The amount of data sent, or 0 if the packet could not be sentimmediately.



receive
public void receive(DatagramPacket p) throws IOException(Code)
This method is provided for convenience and mimics blocking behavior by invoking the nonblocking nbReceive() operation. If no packet could be immediately received it returns immediately with a received packet length of 0.

Use of this method is not recommended and is provided only for compatibility with java.net.DatagramSocket.




send
public void send(DatagramPacket p) throws IOException(Code)
This method is provided for convenience and mimics blocking behavior by invoking the nonblocking nbSend() operation. If the packet could not be immediately sent it is simply dropped (because this is a UDP socket this behavior is consistent with the lack of reliability in UDP).

Use of this method is not recommended and is provided only for compatibility with java.net.DatagramSocket.




setReceiveBufferSize
public void setReceiveBufferSize(int size) throws SocketException(Code)



setSendBufferSize
public void setSendBufferSize(int size) throws SocketException(Code)



Methods inherited from java.net.DatagramSocket
public synchronized void bind(SocketAddress addr) throws SocketException(Code)(Java Doc)
public void close()(Code)(Java Doc)
public void connect(InetAddress address, int port)(Code)(Java Doc)
public void connect(SocketAddress addr) throws SocketException(Code)(Java Doc)
public void disconnect()(Code)(Java Doc)
public synchronized boolean getBroadcast() throws SocketException(Code)(Java Doc)
public DatagramChannel getChannel()(Code)(Java Doc)
public InetAddress getInetAddress()(Code)(Java Doc)
public InetAddress getLocalAddress()(Code)(Java Doc)
public int getLocalPort()(Code)(Java Doc)
public SocketAddress getLocalSocketAddress()(Code)(Java Doc)
public int getPort()(Code)(Java Doc)
public synchronized int getReceiveBufferSize() throws SocketException(Code)(Java Doc)
public SocketAddress getRemoteSocketAddress()(Code)(Java Doc)
public synchronized boolean getReuseAddress() throws SocketException(Code)(Java Doc)
public synchronized int getSendBufferSize() throws SocketException(Code)(Java Doc)
public synchronized int getSoTimeout() throws SocketException(Code)(Java Doc)
public synchronized int getTrafficClass() throws SocketException(Code)(Java Doc)
public boolean isBound()(Code)(Java Doc)
public boolean isClosed()(Code)(Java Doc)
public boolean isConnected()(Code)(Java Doc)
public synchronized void receive(DatagramPacket p) throws IOException(Code)(Java Doc)
public void send(DatagramPacket p) throws IOException(Code)(Java Doc)
public synchronized void setBroadcast(boolean on) throws SocketException(Code)(Java Doc)
public static synchronized void setDatagramSocketImplFactory(DatagramSocketImplFactory fac) throws IOException(Code)(Java Doc)
public synchronized void setReceiveBufferSize(int size) throws SocketException(Code)(Java Doc)
public synchronized void setReuseAddress(boolean on) throws SocketException(Code)(Java Doc)
public synchronized void setSendBufferSize(int size) throws SocketException(Code)(Java Doc)
public synchronized void setSoTimeout(int timeout) throws SocketException(Code)(Java Doc)
public synchronized void setTrafficClass(int tc) throws SocketException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.