Java Doc for MulticastSocket.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.DatagramSocket
      java.net.MulticastSocket

MulticastSocket
public class MulticastSocket extends DatagramSocket (Code)
This class models a multicast socket for sending & receiving datagram packets to a multicast group.
See Also:   DatagramSocket


Field Summary
final static  intSO_REUSEPORT
    

Constructor Summary
public  MulticastSocket()
     Constructs a multicast socket, bound to any available port on the localhost.
public  MulticastSocket(int aPort)
     Answers a multicast socket, bound to the nominated port on the localhost.
public  MulticastSocket(SocketAddress localAddr)
     Constructs a MulticastSocket bound to the host/port specified by the SocketAddress, or an unbound DatagramSocket if the SocketAddress is null.

Method Summary
synchronized  voidcreateSocket(int aPort, InetAddress addr)
    
public  InetAddressgetInterface()
     Answer the network address used by the socket.
public  booleangetLoopbackMode()
     Get the state of the IP_MULTICAST_LOOP socket option.
public  NetworkInterfacegetNetworkInterface()
     Answer the network interface used by the socket.
public  bytegetTTL()
     Answer the time-to-live (TTL) for multicast packets sent on this socket.
public  intgetTimeToLive()
     Answer the time-to-live (TTL) for multicast packets sent on this socket.
public  voidjoinGroup(InetAddress groupAddr)
     Add this socket to the multicast group.
public  voidjoinGroup(SocketAddress groupAddress, NetworkInterface netInterface)
     Add this socket to the multicast group.
public  voidleaveGroup(InetAddress groupAddr)
     Remove the socket from the multicast group.
public  voidleaveGroup(SocketAddress groupAddress, NetworkInterface netInterface)
     Remove the socket from the multicast group.
public  voidsend(DatagramPacket pack, byte ttl)
     Send the packet on this socket.
public  voidsetInterface(InetAddress addr)
     Set the network address used by the socket.
public  voidsetLoopbackMode(boolean loop)
     Set the IP_MULTICAST_LOOP socket option.
public  voidsetNetworkInterface(NetworkInterface netInterface)
     Set the network interface used by the socket.
public  voidsetTTL(byte ttl)
     Set the time-to-live (TTL) for multicast packets sent on this socket.
public  voidsetTimeToLive(int ttl)
     Set the time-to-live (TTL) for multicast packets sent on this socket.

Field Detail
SO_REUSEPORT
final static int SO_REUSEPORT(Code)




Constructor Detail
MulticastSocket
public MulticastSocket() throws IOException(Code)
Constructs a multicast socket, bound to any available port on the localhost.
throws:
  IOException - if a problem occurs creating or binding the socket



MulticastSocket
public MulticastSocket(int aPort) throws IOException(Code)
Answers a multicast socket, bound to the nominated port on the localhost.
Parameters:
  aPort - the port to bind on the localhost
throws:
  IOException - if a problem occurs creating or binding the socket



MulticastSocket
public MulticastSocket(SocketAddress localAddr) throws IOException(Code)
Constructs a MulticastSocket bound to the host/port specified by the SocketAddress, or an unbound DatagramSocket if the SocketAddress is null.
Parameters:
  localAddr - the local machine address and port to bind to
throws:
  IllegalArgumentException - if the SocketAddress is not supported
throws:
  IOException - if a problem occurs creating or binding the socket
since:
   1.4




Method Detail
createSocket
synchronized void createSocket(int aPort, InetAddress addr) throws SocketException(Code)



getInterface
public InetAddress getInterface() throws SocketException(Code)
Answer the network address used by the socket. This is useful on multi-homed machines. java.net.InetAddress the network address
exception:
  java.net.SocketException - The exception thrown while getting the address



getLoopbackMode
public boolean getLoopbackMode() throws SocketException(Code)
Get the state of the IP_MULTICAST_LOOP socket option. true if the IP_MULTICAST_LOOP is enabled,false otherwise.
throws:
  SocketException - if the socket is closed or the option is invalid.
since:
   1.4



getNetworkInterface
public NetworkInterface getNetworkInterface() throws SocketException(Code)
Answer the network interface used by the socket. This is useful on multi-homed machines. java.net.NetworkInterface the network address
exception:
  java.net.SocketException - The exception thrown while getting the address
since:
   1.4



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



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



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



joinGroup
public void joinGroup(SocketAddress groupAddress, 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:
  groupAddress - the multicast group to be joined
Parameters:
  netInterface - the network interface on which the addresses should be dropped
exception:
  IOException - will be thrown if address is not a multicast address
exception:
  java.lang.SecurityException - will be thrown if caller is not authorized to join group
exception:
  java.lang.IllegalArgumentException - will be through if groupAddr is null
since:
   1.4



leaveGroup
public void leaveGroup(InetAddress groupAddr) throws IOException(Code)
Remove the socket from the multicast group.
Parameters:
  groupAddr - the multicast group to be left
exception:
  IOException - will be thrown if address is not a multicast address
exception:
  java.lang.SecurityException - will be thrown if caller is not authorized to join group
exception:
  java.lang.IllegalArgumentException - will be through if groupAddr is null



leaveGroup
public void leaveGroup(SocketAddress groupAddress, NetworkInterface netInterface) throws IOException(Code)
Remove the socket from the multicast group.
Parameters:
  groupAddress - the multicast group to be left
Parameters:
  netInterface - the network interface on which the addresses should be dropped
exception:
  IOException - will be thrown if address is not a multicast address
exception:
  java.lang.SecurityException - will be thrown if caller is not authorized to join group
exception:
  java.lang.IllegalArgumentException - will be through if groupAddr is null
since:
   1.4



send
public void send(DatagramPacket pack, byte ttl) throws IOException(Code)
Send the packet on this socket. The packet must satisfy the security policy before it may be sent.
Parameters:
  pack - the DatagramPacket to send
Parameters:
  ttl - the TTL setting for this transmission, overriding the socketdefault
exception:
  IOException - If a send error occurs.



setInterface
public void setInterface(InetAddress addr) throws SocketException(Code)
Set the network address used by the socket. This is useful on multi-homed machines.
Parameters:
  addr - java.net.InetAddress the interface network address
exception:
  java.net.SocketException - the exception may be thrown while setting the address



setLoopbackMode
public void setLoopbackMode(boolean loop) throws SocketException(Code)
Set the IP_MULTICAST_LOOP socket option.
Parameters:
  loop - the socket IP_MULTICAST_LOOP option setting
throws:
  SocketException - if the socket is closed or the option is invalid.
since:
   1.4



setNetworkInterface
public void setNetworkInterface(NetworkInterface netInterface) throws SocketException(Code)
Set the network interface used by the socket. This is useful on multi-homed machines.
Parameters:
  netInterface - NetworkInterface the interface to be used
exception:
  java.net.SocketException - the exception may be thrown while setting the address
since:
   1.4



setTTL
public 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, 0exception:
  IOException - The exception thrown while setting the TTL
See Also:   MulticastSocket.setTimeToLive(int)



setTimeToLive
public 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, 0<=ttl<= 255
exception:
  IOException - The exception thrown while setting the TTL



Fields inherited from java.net.DatagramSocket
InetAddress address(Code)(Java Doc)
static DatagramSocketImplFactory factory(Code)(Java Doc)
DatagramSocketImpl impl(Code)(Java Doc)
boolean isBound(Code)(Java Doc)
int port(Code)(Java Doc)

Methods inherited from java.net.DatagramSocket
public void bind(SocketAddress localAddr) throws SocketException(Code)(Java Doc)
void checkClosedAndBind(boolean bind) throws SocketException(Code)(Java Doc)
void checkListen(int aPort)(Code)(Java Doc)
public void close()(Code)(Java Doc)
public void connect(InetAddress anAddress, int aPort)(Code)(Java Doc)
public void connect(SocketAddress remoteAddr) throws SocketException(Code)(Java Doc)
synchronized void createSocket(int aPort, InetAddress addr) throws SocketException(Code)(Java Doc)
public void disconnect()(Code)(Java Doc)
public 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 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 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 pack) throws IOException(Code)(Java Doc)
public void send(DatagramPacket pack) throws IOException(Code)(Java Doc)
public void setBroadcast(boolean broadcast) 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 void setReuseAddress(boolean reuse) 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 void setTrafficClass(int value) throws SocketException(Code)(Java Doc)

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.