Java Doc for DatagramSocketImpl.java in  » Apache-Harmony-Java-SE » java-package » java » net » 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 » Apache Harmony Java SE » java package » java.net 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.net.DatagramSocketImpl

DatagramSocketImpl
abstract public class DatagramSocketImpl implements SocketOptions(Code)
The abstract superclass of datagram & multicast socket implementations.


Field Summary
protected  FileDescriptorfd
    
protected  intlocalPort
    

Constructor Summary
public  DatagramSocketImpl()
     Constructs an unbound datagram socket implementation.

Method Summary
abstract protected  voidbind(int port, InetAddress addr)
     Bind the datagram socket to the nominated localhost/port.
abstract protected  voidclose()
     Close the socket.
protected  voidconnect(InetAddress inetAddr, int port)
     Connect the socket to the specified remote address and port.
abstract protected  voidcreate()
     This method allocates the socket descriptor in the underlying operating system.
protected  voiddisconnect()
     Disconnect the socket from the remote address and port.
protected  FileDescriptorgetFileDescriptor()
     Answer the FileDescriptor, which will be invalid if the socket is closed or not bound.
 InetAddressgetLocalAddress()
     Answer the local address to which the socket is bound.
protected  intgetLocalPort()
     Answer the local port.
abstract public  ObjectgetOption(int optID)
     Answer the nominated socket option.
abstract protected  bytegetTTL()
     Answer the time-to-live (TTL) for multicast packets sent on this socket.
abstract protected  intgetTimeToLive()
     Answer the time-to-live (TTL) for multicast packets sent on this socket.
abstract protected  voidjoin(InetAddress addr)
     Add this socket to the multicast group.
abstract protected  voidjoinGroup(SocketAddress addr, NetworkInterface netInterface)
     Add this socket to the multicast group.
abstract protected  voidleave(InetAddress addr)
     Remove the socket from the multicast group.
abstract protected  voidleaveGroup(SocketAddress addr, NetworkInterface netInterface)
     Remove the socket from the multicast group.
abstract protected  intpeek(InetAddress sender)
     Peek at the incoming packet to this socket and answer the sender's address into sender.
abstract protected  intpeekData(DatagramPacket pack)
     Receive data into the supplied datagram packet by peeking.
abstract protected  voidreceive(DatagramPacket pack)
     Receive data into the supplied datagram packet.
abstract protected  voidsend(DatagramPacket pack)
     Sends the supplied datagram packet.
abstract public  voidsetOption(int optID, Object val)
     Set the nominated socket option.
abstract protected  voidsetTTL(byte ttl)
     Set the time-to-live (TTL) for multicast packets sent on this socket.
abstract protected  voidsetTimeToLive(int ttl)
     Set the time-to-live (TTL) for multicast packets sent on this socket.

Field Detail
fd
protected FileDescriptor fd(Code)



localPort
protected int localPort(Code)




Constructor Detail
DatagramSocketImpl
public DatagramSocketImpl()(Code)
Constructs an unbound datagram socket implementation.




Method Detail
bind
abstract protected void bind(int port, InetAddress addr) throws SocketException(Code)
Bind the datagram socket to the nominated localhost/port. Sockets must be bound prior to attempting to send or receive data.
Parameters:
  port - the port on the localhost to bind
Parameters:
  addr - the address on the multihomed localhost to bind
exception:
  SocketException - if an error occurred during bind, such as if the port wasalready bound



close
abstract protected void close()(Code)
Close the socket.



connect
protected void connect(InetAddress inetAddr, int port) throws SocketException(Code)
Connect the socket to the specified remote address and port.
Parameters:
  inetAddr - the remote address
Parameters:
  port - the remote port
exception:
  SocketException - possibly thrown, if the datagram socket cannot beconnected to the specified remote address and port



create
abstract protected void create() throws SocketException(Code)
This method allocates the socket descriptor in the underlying operating system.



disconnect
protected void disconnect()(Code)
Disconnect the socket from the remote address and port.



getFileDescriptor
protected FileDescriptor getFileDescriptor()(Code)
Answer the FileDescriptor, which will be invalid if the socket is closed or not bound. FileDescriptor the socket file descriptor



getLocalAddress
InetAddress getLocalAddress()(Code)
Answer the local address to which the socket is bound. InetAddress the local address to which the socket is bound.



getLocalPort
protected int getLocalPort()(Code)
Answer the local port. If the socket was bound to any available port, as flagged by a localPort value of -1, query the IP stack. int the local port to which the socket is bound.



getOption
abstract public Object getOption(int optID) throws SocketException(Code)
Answer the nominated socket option.
Parameters:
  optID - the socket option to retrieve Object the option value
exception:
  SocketException - thrown if an error occurs while accessing the option



getTTL
abstract protected byte getTTL() throws IOException(Code)
Answer the time-to-live (TTL) for multicast packets sent on this socket. java.net.InetAddress
throws:
  IOException - The exception description.
See Also:   DatagramSocketImpl.getTimeToLive()



getTimeToLive
abstract protected int getTimeToLive() throws IOException(Code)
Answer the time-to-live (TTL) for multicast packets sent on this socket. int
throws:
  IOException - The exception description.



join
abstract protected void join(InetAddress addr) throws IOException(Code)
Add this socket to the multicast group. A socket must join a group before data may be received. A socket may be a member of multiple groups but may join any group once.
Parameters:
  addr - the multicast group to be joined
throws:
  IOException - may be thrown while joining a group



joinGroup
abstract protected void joinGroup(SocketAddress addr, NetworkInterface netInterface) throws IOException(Code)
Add this socket to the multicast group. A socket must join a group before data may be received. A socket may be a member of multiple groups but may join any group once.
Parameters:
  addr - the multicast group to be joined
Parameters:
  netInterface - the network interface on which the addresses should be dropped
throws:
  IOException - may be thrown while joining a group



leave
abstract protected void leave(InetAddress addr) throws IOException(Code)
Remove the socket from the multicast group.
Parameters:
  addr - the multicast group to be left
throws:
  IOException - May be thrown while leaving the group



leaveGroup
abstract protected void leaveGroup(SocketAddress addr, NetworkInterface netInterface) throws IOException(Code)
Remove the socket from the multicast group.
Parameters:
  addr - the multicast group to be left
Parameters:
  netInterface - the network interface on which the addresses should be dropped
throws:
  IOException - May be thrown while leaving the group



peek
abstract protected int peek(InetAddress sender) throws IOException(Code)
Peek at the incoming packet to this socket and answer the sender's address into sender. The method will block until a packet is received or timeout expires and returns the sender's port.
exception:
  IOException - if a read error or timeout occurs



peekData
abstract protected int peekData(DatagramPacket pack) throws IOException(Code)
Receive data into the supplied datagram packet by peeking. The data is not removed and will be received by another peekData() or receive() call. This call will block until either data is received or, if a timeout is set, the timeout expires.
Parameters:
  pack - the DatagramPacket used to store the data the port the packet was received from
exception:
  IOException - if an error occurs



receive
abstract protected void receive(DatagramPacket pack) throws IOException(Code)
Receive data into the supplied datagram packet. This call will block until either data is received or, if a timeout is set, the timeout expires. If the timeout expires, the InterruptedIOException is thrown.
exception:
  IOException - if a read error or timeout occurs



send
abstract protected void send(DatagramPacket pack) throws IOException(Code)
Sends the supplied datagram packet. The packet contains the destination host & port.
Parameters:
  pack - DatagramPacket to send
exception:
  IOException - if a write error occurs



setOption
abstract public void setOption(int optID, Object val) throws SocketException(Code)
Set the nominated socket option.
Parameters:
  optID - the socket option to set
Parameters:
  val - the option value
exception:
  SocketException - thrown if an error occurs while setting the option



setTTL
abstract protected void setTTL(byte ttl) throws IOException(Code)
Set the time-to-live (TTL) for multicast packets sent on this socket.
Parameters:
  ttl - the time-to-live, 0throws:
  IOException - The exception thrown while setting the TTL
See Also:   DatagramSocketImpl.setTimeToLive(int)



setTimeToLive
abstract protected void setTimeToLive(int ttl) throws IOException(Code)
Set the time-to-live (TTL) for multicast packets sent on this socket.
Parameters:
  ttl - the time-to-live, 0throws:
  IOException - The exception thrown while setting the TTL



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) 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.