- 浏览: 981110 次
文章分类
- 全部博客 (428)
- Hadoop (2)
- HBase (1)
- ELK (1)
- ActiveMQ (13)
- Kafka (5)
- Redis (14)
- Dubbo (1)
- Memcached (5)
- Netty (56)
- Mina (34)
- NIO (51)
- JUC (53)
- Spring (13)
- Mybatis (17)
- MySQL (21)
- JDBC (12)
- C3P0 (5)
- Tomcat (13)
- SLF4J-log4j (9)
- P6Spy (4)
- Quartz (12)
- Zabbix (7)
- JAVA (9)
- Linux (15)
- HTML (9)
- Lucene (0)
- JS (2)
- WebService (1)
- Maven (4)
- Oracle&MSSQL (14)
- iText (11)
- Development Tools (8)
- UTILS (4)
- LIFE (8)
最新评论
-
Donald_Draper:
Donald_Draper 写道刘落落cici 写道能给我发一 ...
DatagramChannelImpl 解析三(多播) -
Donald_Draper:
刘落落cici 写道能给我发一份这个类的源码吗Datagram ...
DatagramChannelImpl 解析三(多播) -
lyfyouyun:
请问楼主,执行消息发送的时候,报错:Transport sch ...
ActiveMQ连接工厂、连接详解 -
ezlhq:
关于 PollArrayWrapper 状态含义猜测:参考 S ...
WindowsSelectorImpl解析一(FdMap,PollArrayWrapper) -
flyfeifei66:
打算使用xmemcache作为memcache的客户端,由于x ...
Memcached分布式客户端(Xmemcached)
NetworkChannel接口定义:http://donald-draper.iteye.com/blog/2369773
MembershipKey定义:http://donald-draper.iteye.com/blog/2372947
MembershipKey定义:http://donald-draper.iteye.com/blog/2372947
package java.nio.channels; import java.net.InetAddress; import java.net.NetworkInterface; import java.io.IOException; import java.net.ProtocolFamily; // javadoc import java.net.StandardProtocolFamily; // javadoc import java.net.StandardSocketOptions; // javadoc /** * A network channel that supports Internet Protocol (IP) multicasting. *MulticastChannel是一个支持多播网络IP协议的网络通道 * IP multicasting is the transmission of IP datagrams to members of * a [i]group[/i] that is zero or more hosts identified by a single destination * address. *IP多播是传输IP报文到多播组目的地址的一个或多个主机。 * <p> In the case of a channel to an {@link StandardProtocolFamily#INET IPv4} socket, * the underlying operating system supports <a href="http://www.ietf.org/rfc/rfc2236.txt"> * <i>RFC 2236: Internet Group Management Protocol, Version 2 (IGMPv2)</i></a>. * It may optionally support source filtering as specified by <a * href="http://www.ietf.org/rfc/rfc3376.txt"> <i>RFC 3376: Internet Group * Management Protocol, Version 3 (IGMPv3)</i></a>. * For channels to an {@link StandardProtocolFamily#INET6 IPv6} socket, the equivalent * standards are <a href="http://www.ietf.org/rfc/rfc2710.txt"> <i>RFC 2710: * Multicast Listener Discovery (MLD) for IPv6</i></a> and <a * href="http://www.ietf.org/rfc/rfc3810.txt"> <i>RFC 3810: Multicast Listener * Discovery Version 2 (MLDv2) for IPv6</i></a>. * 一个ip4的socket网络通道底层支持IGMPv2,可以源地址过滤的IGMPv3。一个IPv6的socket网络通道 ,对应的为MLD,MLDv2。 * <p> The {@link #join(InetAddress,NetworkInterface)} method is used to * join a group and receive all multicast datagrams sent to the group. A channel * may join several multicast groups and may join the same group on several * {@link NetworkInterface interfaces}. Membership is dropped by invoking the {@link * MembershipKey#drop drop} method on the returned {@link MembershipKey}. If the * underlying platform supports source filtering then the {@link MembershipKey#block * block} and {@link MembershipKey#unblock unblock} methods can be used to block or * unblock multicast datagrams from particular source addresses. *join(InetAddress,NetworkInterface)方法加入一个多播组,接受发送到多播组的报文。 一个多播通道可以加入多个多播分组,或加入多个网卡接口的相同多播分组。调用MembershipKey的 drop方法,将会丢弃Membership,即MembershipKey无效。如果底层操作系统支持源地址过滤,则 可以调用MembershipKey#block和#unblock方法,用于阻塞从特殊源地址的报文或解除从特殊源地址的报文阻塞。 * <p> The {@link #join(InetAddress,NetworkInterface,InetAddress)} method * is used to begin receiving datagrams sent to a group whose source address matches * a given source address. This method throws {@link UnsupportedOperationException} * if the underlying platform does not support source filtering. Membership is * [i]cumulative[/i] and this method may be invoked again with the same group * and interface to allow receiving datagrams from other source addresses. The * method returns a {@link MembershipKey} that represents membership to receive * datagrams from the given source address. Invoking the key's {@link * MembershipKey#drop drop} method drops membership so that datagrams from the * source address can no longer be received. *#join(InetAddress,NetworkInterface,InetAddress)方法为,加入一个多播组, 开始接受发送到多播组的源地址报文。如果底层平台不支持源地址过滤,则抛出UnsupportedOperationException。 多播组成员关系是可以累加的,,此方法以相同的多播地址和网络接口参数可以多次调用, 即允许接受多个源地址发送到多播组的报文。此方法返回一个表示接受指定源地址报文的多播关系key。 调用MembershipKey#drop方法,将解除多播成员关系,即不在接受源地址发送的多播报文。 * <h4>Platform dependencies</h4> *平台依赖性 * The multicast implementation is intended to map directly to the native * multicasting facility. Consequently, the following items should be considered * when developing an application that receives IP multicast datagrams: *多播的实现是需要直接映射到本地的多播硬件设备。因此在开发一个接受多播ip的报文时, 需要考虑一下几条: * [list=1] * * <li><p> The creation of the channel should specify the {@link ProtocolFamily} * that corresponds to the address type of the multicast groups that the channel * will join. There is no guarantee that a channel to a socket in one protocol * family can join and receive multicast datagrams when the address of the * multicast group corresponds to another protocol family. For example, it is * implementation specific if a channel to an {@link StandardProtocolFamily#INET6 IPv6} * socket can join an {@link StandardProtocolFamily#INET IPv4} multicast group and receive * multicast datagrams sent to the group. </li> *通道创建时应该确定通道加入的多播组地址类型的ProtocolFamily。多播通道不能保证, 一个ProtocolFamily类型的socket可以接受另外一个ProtocolFamily类型的多播组报文,或者说 不能保证能加入另外一个ProtocolFamily类型多播组。比如通道的socket的协议组为StandardProtocolFamily#INET6 IPv6 ,而加入的多播组为StandardProtocolFamily#INET IPv4。这段话的含义为,通道在创建关联一个 协议ProtocolFamily,具体的协议通道,只能加入相应的多播协议组。及INET6通道只能加入ip6地址多播组, INET通道只能加入ip4地址多播组。 //DatagramChannel,打开一个指定协议的报文通道 public static DatagramChannel open(ProtocolFamily family) throws IOException { return SelectorProvider.provider().openDatagramChannel(family); } * <li> The channel's socket should be bound to the {@link * InetAddress#isAnyLocalAddress wildcard} address. If the socket is bound to * a specific address, rather than the wildcard address then it is implementation * specific if multicast datagrams are received by the socket. </li> *通道应该绑定一个本地地址。如果绑定为一个特定的地址,而不是本地地址,具体的通道实现 需要确定是否多播报文可以通过socket接受。 * <li> The {@link StandardSocketOptions#SO_REUSEADDR SO_REUSEADDR} option should be * enabled prior to {@link NetworkChannel#bind binding} the socket. This is * required to allow multiple members of the group to bind to the same * address. </li> *StandardSocketOptions#SO_REUSEADDR应该在地址绑定前,配置地址重用选项。 以便多个成员能够绑定同样的地址,加入多播组。 * [/list] * * <p> <b>Usage Example:</b> * <pre>使用实例 * // join multicast group on this interface, and also use this * // interface for outgoing multicast datagrams 加入一个指定网卡的多播组,同时用这个网卡发送多播报文 * NetworkInterface ni = NetworkInterface.getByName("hme0"); * * DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET) * .setOption(StandardSocketOptions.SO_REUSEADDR, true) * .bind(new InetSocketAddress(5000)) * .setOption(StandardSocketOptions.IP_MULTICAST_IF, ni); * * InetAddress group = InetAddress.getByName("225.4.5.6"); * * MembershipKey key = dc.join(group, ni); * </pre> * * @since 1.7 */ //多播通道 public interface MulticastChannel extends NetworkChannel { /** * Closes this channel. *关闭通道 * <p> If the channel is a member of a multicast group then the membership * is {@link MembershipKey#drop dropped}. Upon return, the {@link * MembershipKey membership-key} will be {@link MembershipKey#isValid * invalid}. *如果通道是一个多播组的成员,在通道关闭时,将会drop相应的MembershipKey。 在方法执行后,MembershipKey将会无效 * <p> This method otherwise behaves exactly as specified by the {@link * Channel} interface. *此方法在其他方面与通道接口相似。 * @throws IOException * If an I/O error occurs */ @Override void close() throws IOException; /** * Joins a multicast group to begin receiving all datagrams sent to the group, * returning a membership key. *加入一个多播组,开始接受发送到多播组的报文,返回MembershipKey。 * <p> If this channel is currently a member of the group on the given * interface to receive all datagrams then the membership key, representing * that membership, is returned. Otherwise this channel joins the group and * the resulting new membership key is returned. The resulting membership key * is not {@link MembershipKey#sourceAddress source-specific}. *如果为指定网络接口地址的组成员,正在接受所有报文,将返回表示成员关系的MembershipKey。 否则通道加入分组,创建一个新的MembershipKey返回。MembershipKey的源地址是不确定的。 * <p> A multicast channel may join several multicast groups, including * the same group on more than one interface. An implementation may impose a * limit on the number of groups that may be joined at the same time. *一个多播通道可以加入多个多播分组,包括在一个或多个网络接口上的相同分组。一个具体 的实现也许会限制同一时间加入多播组的数量。 * @param group * The multicast address to join * @param interf * The network interface on which to join the group * * @return The membership key * * @throws IllegalArgumentException,多播组地址为非多播地址,或通道不支持多播组地址参数 * If the group parameter is not a {@link InetAddress#isMulticastAddress * multicast} address, or the group parameter is an address type * that is not supported by this channel * @throws IllegalStateException,如果通道已经加入源地址确定的对应的网络接口上的多播组 * If the channel already has source-specific membership of the * group on the interface * @throws UnsupportedOperationException 如果通道不是一个网络写socket * If the channel's socket is not an Internet Protocol socket * @throws ClosedChannelException * If this channel is closed * @throws IOException * If an I/O error occurs * @throws SecurityException * If a security manager is set, and its * {@link SecurityManager#checkMulticast(InetAddress) checkMulticast} * method denies access to the multiast group */ MembershipKey join(InetAddress group, NetworkInterface interf) throws IOException; /** * Joins a multicast group to begin receiving datagrams sent to the group * from a given source address. *加入一个多播组,开始接受发送到多播组的源地址报文,返回MembershipKey。 * <p> If this channel is currently a member of the group on the given * interface to receive datagrams from the given source address then the * membership key, representing that membership, is returned. Otherwise this * channel joins the group and the resulting new membership key is returned. * The resulting membership key is {@link MembershipKey#sourceAddress * source-specific}. *如果为指定网络接口地址的组成员,正在接受所有源地址的报文,将返回表示成员关系的MembershipKey。 否则通道加入分组,创建一个新的MembershipKey返回。MembershipKey的源地址是确定的。 * <p> Membership is [i]cumulative[/i] and this method may be invoked * again with the same group and interface to allow receiving datagrams sent * by other source addresses to the group. *多播组成员关系是可以累加的,此方法以相同的多播地址和网络接口参数可以多次调用, 即允许从多个源地址发送报文到多播组。 * @param group * The multicast address to join * @param interf * The network interface on which to join the group * @param source * The source address * * @return The membership key * * @throws IllegalArgumentException * If the group parameter is not a {@link * InetAddress#isMulticastAddress multicast} address, the * source parameter is not a unicast address, the group * parameter is an address type that is not supported by this channel, * or the source parameter is not the same address type as the group * @throws IllegalStateException * If the channel is currently a member of the group on the given * interface to receive all datagrams * @throws UnsupportedOperationException * If the channel's socket is not an Internet Protocol socket or * source filtering is not supported * @throws ClosedChannelException * If this channel is closed * @throws IOException * If an I/O error occurs * @throws SecurityException * If a security manager is set, and its * {@link SecurityManager#checkMulticast(InetAddress) checkMulticast} * method denies access to the multiast group */ MembershipKey join(InetAddress group, NetworkInterface interf, InetAddress source) throws IOException; }
发表评论
-
文件通道解析二(文件锁,关闭通道)
2017-05-16 23:17 1068文件通道解析一(读写操作,通道数据传输等):http://do ... -
文件通道解析一(读写操作,通道数据传输等)
2017-05-16 10:04 1164Reference定义(PhantomRefere ... -
文件通道创建方式综述
2017-05-15 17:39 1067Reference定义(PhantomReference,Cl ... -
文件读写方式简单综述后续(文件,流构造)
2017-05-14 23:04 1481Java Socket通信实例:http://donald-d ... -
文件读写方式简单综述
2017-05-14 11:13 1136Java Socket通信实例:http://donald-d ... -
FileChanne定义
2017-05-12 23:28 938文件读写方式简单综述:http://donald-draper ... -
SeekableByteChannel接口定义
2017-05-11 08:43 1236ByteChannel,分散聚集通道接口的定义(SocketC ... -
FileChannel示例
2017-05-11 08:37 993前面我们看过socket通道,datagram通道,以管道Pi ... -
PipeImpl解析
2017-05-11 08:41 934ServerSocketChannel定义:http://do ... -
Pipe定义
2017-05-10 09:07 906Channel接口定义:http://donald-drape ... -
NIO-Pipe示例
2017-05-10 08:47 906PipeImpl解析:http://donald-draper ... -
DatagramChannelImpl 解析四(地址绑定,关闭通道等)
2017-05-10 08:27 780DatagramChannelImpl 解析一(初始化):ht ... -
DatagramChannelImpl 解析三(多播)
2017-05-10 08:20 1901DatagramChannelImpl 解析一(初始化):ht ... -
NIO-UDP实例
2017-05-09 12:32 1586DatagramChannelImpl 解析一(初始化):ht ... -
DatagramChannelImpl 解析二(报文发送与接收)
2017-05-09 09:03 1406DatagramChannelImpl 解析一(初始化):ht ... -
DatagramChannelImpl 解析一(初始化)
2017-05-08 21:52 1411Channel接口定义:http://donald-drape ... -
MembershipKeyImpl 简介
2017-05-08 09:11 925MembershipKey定义:http://donald-d ... -
DatagramChannel定义
2017-05-07 23:13 1229Channel接口定义:http://donald-drape ... -
MembershipKey定义
2017-05-06 16:20 918package java.nio.channels; i ... -
SocketChannelImpl 解析四(关闭通道等)
2017-05-05 08:38 2533SocketChannelImpl 解析一(通道连接,发送数据 ...
相关推荐
iOS版微信抢红包Tweak.zip小程序
该资源内项目源码是个人的课程设计、毕业设计,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! ## 项目备注 1、该资源内项目代码都经过严格测试运行成功才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。
基于springboot社区停车信息管理系统.zip
基于springboot南皮站化验室管理系统源码数据库文档.zip
## 数据指标说明 全要素生产率(TFP)也可以称之为系统生产率。指生产单位(主要为企业)作为系统中的各个要素的综合生产率,以区别于要素生产率(如技术生产率)。测算公式为:全要素生产率=产出总量/全部资源投入量。 数据测算:包含OL、FE、LP、OP、GMM共五种TFP测算方法!数据结果包括excel和dta格式,其中重要指标包括证券代码,固定资产净额,营业总收入,营业收入,营业成本,销售费用,管理费用,财务费用,购建固定资产无形资产和其他长期资产支付的现金,支付给职工以及为职工支付的现金,员工人数,折旧摊销,行业代码,上市日期,AB股交叉码,退市日期,年末是否ST或PT等变量指标分析。文件包括计算方法说明及原始数据和代码。 数据名称:上市公司全要素生产率TFP数据及测算方法(OL、FE、LP、OP、GMM) 数据年份:2000-2023年 数据指标:证券代码、year、TFP_OLS、TFP_FE、TFP_LP1、TFP_OP、TFP_OPacf、TFP_GMM
内容概要:本文详细总结了多种编程语言下常用的算法实现资源,涵盖Python、C++、Java等流行编程语言及其相关的开源平台、在线课程和权威书籍。对于每种语言而言,均提供了具体资源列表,包括开源项目、标准库支持、在线课程及专业书籍推荐。 适合人群:适用于所有希望深入研究并提高特定编程语言算法能力的学习者,无论是编程新手还是有一定经验的技术人员。 使用场景及目标:帮助开发者快速定位到合适的算法学习资料,无论是出于个人兴趣自学、面试准备或是实际工作中遇到的具体算法问题,都能找到合适的解决方案。 其他说明:文中提及多个在线学习平台和社区网站,不仅限于某一特定语言,对于跨学科或多元化技能培养也具有很高的参考价值。
基于springboot的交通旅游订票系统源码数据库文档.zip
内容概要:本文档是一份详细的GO语言教程,涵盖了Go语言的基础语法、数据类型、控制结构、函数、结构体、接口以及并发编程等多个方面。主要内容包括Go语言的基本概念和历史背景、环境配置、基本语法(如变量、数据类型、控制结构)、函数定义与调用、高级特性(如闭包、可变参数)、自定义数据类型(如结构体、接口)以及并发编程(如goroutine、channel、select)等内容。每部分内容都附有具体的代码示例,帮助读者理解和掌握相关知识点。 适合人群:具备一定编程基础的开发者,尤其是希望深入学习和应用Go语言的技术人员。 使用场景及目标:①初学者通过本教程快速入门Go语言;②有一定经验的开发者系统复习和完善Go语言知识;③实际项目开发中利用Go语言解决高性能、高并发的编程问题。 阅读建议:本文档全面介绍了Go语言的各项基础知识和技术细节,建议按章节顺序逐步学习,通过动手实践代码示例加深理解。对于复杂的概念和技术点,可以通过查阅更多资料或进行深入研究来巩固知识。
GEE训练教程
memcached笔记资料,配套视频:https://www.bilibili.com/list/474327672?sid=4486766&spm_id_from=333.999.0.0&desc=1
基于springboot校内跑腿业务系统源码数据库文档.zip
计算机控制光感自动窗帘控制系统设计.doc
基于SpringBoot的校园服务系统源码数据库文档.zip
基于SpringBoot+Vue的美容店信息管理系统源码数据库文档.zip
基于springboot程序设计基础课程辅助教学系统源码数据库文档.zip
这是一个原生的JS网页版斗地主小游戏,代码注释全。带有斗地主游戏基本的地主、选牌、提示、出牌、倒计时等功能。简单好玩,欢迎下载
基于springboot亚运会志愿者管理系统源码数据库文档.zip
该资源内项目源码是个人的课程设计、毕业设计,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! ## 项目备注 1、该资源内项目代码都经过严格测试运行成功才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。
GEE训练教程——Landsat5、8和Sentinel-2、DEM和各2哦想指数下载
基于springboot家校合作平台源码数据库文档.zip