- 浏览: 950798 次
文章分类
- 全部博客 (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)
Channel接口定义:http://donald-draper.iteye.com/blog/2369111
AbstractInterruptibleChannel接口定义:http://donald-draper.iteye.com/blog/2369238
SelectableChannel接口定义:http://donald-draper.iteye.com/blog/2369317
SelectionKey定义:http://donald-draper.iteye.com/blog/2369499
SelectorProvider定义:http://donald-draper.iteye.com/blog/2369615
AbstractSelectableChannel定义:http://donald-draper.iteye.com/blog/2369742
先来回顾一下ServerSocketChannel继承结构树:
到目前这篇文章之前我们,看完了socket的通道的一个可选择通道分支,在这个过程成,我们
看了一下选择key,通道选择器提供者的定义,今天我们来看另一个分支网络通道:
从网络通道NetworkChannel的定义来看,主要作用是绑定socket的local地址,获取绑定的地址,
以及设置或获取socket选项。
//SocketOption
AbstractInterruptibleChannel接口定义:http://donald-draper.iteye.com/blog/2369238
SelectableChannel接口定义:http://donald-draper.iteye.com/blog/2369317
SelectionKey定义:http://donald-draper.iteye.com/blog/2369499
SelectorProvider定义:http://donald-draper.iteye.com/blog/2369615
AbstractSelectableChannel定义:http://donald-draper.iteye.com/blog/2369742
先来回顾一下ServerSocketChannel继承结构树:
//ServerSocketChannel public abstract class ServerSocketChannel extends AbstractSelectableChannel implements NetworkChannel //AbstractSelectableChannel public abstract class AbstractSelectableChannel extends SelectableChannel //SelectableChannel public abstract class SelectableChannel extends AbstractInterruptibleChannel implements Channel
到目前这篇文章之前我们,看完了socket的通道的一个可选择通道分支,在这个过程成,我们
看了一下选择key,通道选择器提供者的定义,今天我们来看另一个分支网络通道:
package java.nio.channels; import java.net.SocketOption; import java.net.SocketAddress; import java.util.Set; import java.io.IOException; /** * A channel to a network socket. * * <p> A channel that implements this interface is a channel to a network * socket. The {@link #bind(SocketAddress) bind} method is used to bind the * socket to a local {@link SocketAddress address}, the {@link #getLocalAddress() * getLocalAddress} method returns the address that the socket is bound to, and * the {@link #setOption(SocketOption,Object) setOption} and {@link * #getOption(SocketOption) getOption} methods are used to set and query socket * options. An implementation of this interface should specify the socket options * that it supports. *NetworkChannel是一个通道到网络socket的实现,#bind用于绑定一个本地socket地址, #getLocalAddress可以返回绑定的地址,#setOption和#getOption用于设置和获取网络通道 的选项配置。接口的实现应该精确支持的选项配置集。 * <p> The {@link #bind bind} and {@link #setOption setOption} methods that do * not otherwise have a value to return are specified to return the network * channel upon which they are invoked. This allows method invocations to be * chained. Implementations of this interface should specialize the return type * so that method invocations on the implementation class can be chained. * #bind和#setOption在调用时,不一定非要返回网络通道,允许被链式调用。网络通道的 具体实现应该明确#bind和#setOption的返回类型,以便可以链式调用。 * @since 1.7 */ public interface NetworkChannel extends Channel { /** * Binds the channel's socket to a local address. *绑定通道socket到本地地址 * <p> This method is used to establish an association between the socket and * a local address. Once an association is established then the socket remains * bound until the channel is closed. If the {@code local} parameter has the * value {@code null} then the socket will be bound to an address that is * assigned automatically. *bind的方法用于建立socket和本地地址的关系。只要关系建立,在通道没关闭之前socket 仍绑定着本地SocketAddress。如果socket地址参数为null,默认socket将绑定自动分配的地址 * @param local * The address to bind the socket, or {@code null} to bind the socket * to an automatically assigned socket address * * @return This channel * * @throws AlreadyBoundException 已绑定 * If the socket is already bound * @throws UnsupportedAddressTypeException 不支持地址类型 * If the type of the given address is not supported * @throws ClosedChannelException 通道关闭 * If the channel is closed * @throws IOException 操作异常 * If some other I/O error occurs * @throws SecurityException 权限访问异常 * If a security manager is installed and it denies an unspecified * permission. An implementation of this interface should specify * any required permissions. * * @see #getLocalAddress */ NetworkChannel bind(SocketAddress local) throws IOException; /** * Returns the socket address that this channel's socket is bound to, or * {@code null} if the socket is not bound. *返回socket通道绑定的socket地址,如果为null,即没有绑定。 * <p> Where the channel is {@link #bind bound} to an Internet Protocol * socket address then the return value from this method is of type {@link * java.net.InetSocketAddress}. *如果通道绑定到一个网络协议socket地址,将会返回一个InetSocketAddress的地址 * @return The socket address that the socket is bound to, or {@code null} * if the channel's socket is not bound * * @throws ClosedChannelException 通道已关闭 * If the channel is closed * @throws IOException IO操作异常 * If an I/O error occurs */ SocketAddress getLocalAddress() throws IOException; /** * Sets the value of a socket option. * 设置socket选项值 * @param name * The socket option * @param value,值为null,对某些socket选项也许是一个有效的值 * The value of the socket option. A value of {@code null} may be * a valid value for some socket options. * * @return This channel * * @throws UnsupportedOperationException ,如果socket选项不被通道支持 * If the socket option is not supported by this channel * @throws IllegalArgumentException 如果值对socket选项是一个无效的值 * If the value is not a valid value for this socket option * @throws ClosedChannelException 通道关闭 * If this channel is closed * @throws IOException 通道IO异常 * If an I/O error occurs * * @see java.net.StandardSocketOptions */ <T> NetworkChannel setOption(SocketOption<T> name, T value) throws IOException; /** * Returns the value of a socket option. * 获取socket选项的值 * @param name * The socket option * * @return The value of the socket option. A value of {@code null} may be * a valid value for some socket options. * * @throws UnsupportedOperationException * If the socket option is not supported by this channel * @throws ClosedChannelException * If this channel is closed * @throws IOException * If an I/O error occurs * * @see java.net.StandardSocketOptions */ <T> T getOption(SocketOption<T> name) throws IOException; /** * Returns a set of the socket options supported by this channel. *返回通道支持的socket选项 * <p> This method will continue to return the set of options even after the * channel has been closed. *即使在通道关闭时,此方法仍返回socket配置选项集 * @return A set of the socket options supported by this channel */ Set<SocketOption<?>> supportedOptions(); }
从网络通道NetworkChannel的定义来看,主要作用是绑定socket的local地址,获取绑定的地址,
以及设置或获取socket选项。
//SocketOption
package java.net; /** * A socket option associated with a socket. * SocketOption为与socket关联的选项配置 * <p> In the {@link java.nio.channels channels} package, the {@link * java.nio.channels.NetworkChannel} interface defines the {@link * java.nio.channels.NetworkChannel#setOption(SocketOption,Object) setOption} * and {@link java.nio.channels.NetworkChannel#getOption(SocketOption) getOption} * methods to set and query the channel's socket options. *在网络通道NetworkChannel中定义了设置和获取socket选择配置的方法。 * @param <T> The type of the socket option value. * * @since 1.7 * * @see StandardSocketOptions */ public interface SocketOption<T> { /** * Returns the name of the socket option. 选型名称 */ String name(); /** * Returns the type of the socket option value. 选项类型 */ Class<T> type(); }
发表评论
-
文件通道解析二(文件锁,关闭通道)
2017-05-16 23:17 992文件通道解析一(读写操作,通道数据传输等):http://do ... -
文件通道解析一(读写操作,通道数据传输等)
2017-05-16 10:04 1102Reference定义(PhantomRefere ... -
文件通道创建方式综述
2017-05-15 17:39 931Reference定义(PhantomReference,Cl ... -
文件读写方式简单综述后续(文件,流构造)
2017-05-14 23:04 1399Java Socket通信实例:http://donald-d ... -
文件读写方式简单综述
2017-05-14 11:13 1068Java Socket通信实例:http://donald-d ... -
FileChanne定义
2017-05-12 23:28 869文件读写方式简单综述:http://donald-draper ... -
SeekableByteChannel接口定义
2017-05-11 08:43 1121ByteChannel,分散聚集通道接口的定义(SocketC ... -
FileChannel示例
2017-05-11 08:37 906前面我们看过socket通道,datagram通道,以管道Pi ... -
PipeImpl解析
2017-05-11 08:41 837ServerSocketChannel定义:http://do ... -
Pipe定义
2017-05-10 09:07 840Channel接口定义:http://donald-drape ... -
NIO-Pipe示例
2017-05-10 08:47 846PipeImpl解析:http://donald-draper ... -
DatagramChannelImpl 解析四(地址绑定,关闭通道等)
2017-05-10 08:27 690DatagramChannelImpl 解析一(初始化):ht ... -
DatagramChannelImpl 解析三(多播)
2017-05-10 08:20 1687DatagramChannelImpl 解析一(初始化):ht ... -
NIO-UDP实例
2017-05-09 12:32 1517DatagramChannelImpl 解析一(初始化):ht ... -
DatagramChannelImpl 解析二(报文发送与接收)
2017-05-09 09:03 1341DatagramChannelImpl 解析一(初始化):ht ... -
DatagramChannelImpl 解析一(初始化)
2017-05-08 21:52 1329Channel接口定义:http://donald-drape ... -
MembershipKeyImpl 简介
2017-05-08 09:11 871MembershipKey定义:http://donald-d ... -
DatagramChannel定义
2017-05-07 23:13 1182Channel接口定义:http://donald-drape ... -
MulticastChanne接口定义
2017-05-07 13:45 1067NetworkChannel接口定义:ht ... -
MembershipKey定义
2017-05-06 16:20 829package java.nio.channels; i ...
相关推荐
本文提出来一个最新的元学习方法,对非常深的神经网络进行自动化通道剪枝。首先训练出一个PruningNet,对于给定目标网络的任何剪枝结构都可以生成权重参数。我们使用一个简单的随机结构采样方法来训练PruningNet,...
DOS下开发Novell Network网络接口的源程序(69KB)
Network Driver Interface Specification,即网络驱动接口规范
主要介绍了如何修改Vue打包后文件的接口地址配置的方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
软件测试工作中,我们时常需要查看接口请求、或者服务器的返回,携带的参数、请求地址、返回的参数、或者token、cookies是否正确,文档中介绍了几种常用的方式。既有PC端,又有移动端,初步介绍了常用的几种方式,...
5G核心网接口 5G核心网接口 User Plane Function,用户面功能:数据转发与路由、数据报文检测和策略执行、用户面QoS处理。 5G核心网接口 Data Network,数据网络:如Internet、企业网等。 5G核心网接口 Access and ...
ruby-fann - 与FANN(Fast Artificial Neural Network)接口的Ruby库
软件定义网络(Software Defined Network, SDN ),是由美国斯坦福大学clean slate研究组提出的一种新型网络创新架构,其核心技术OpenFlow通过将网络设备控制面与数据面分离开来,从而实现了网络流量的灵活控制,为...
作为一种新型网络架构,软件定义网络(software defined network,简称 SDN)将网络的数据层和控制层分 离,通过集中化控制和提供开放控制接口,简化网络管理,支持网络服务的动态应用程序控制.流量工程通过对网络 流量的...
新接口,新设备,新数据 SU MMI T 构建安全的新型软件定义网络全文共16页,当前为第2页。 IT OT CT IT/CT/OT 围绕数据融合 SU MMI T 构建安全的新型软件定义网络全文共16页,当前为第3页。 复杂网络环境对数据传输...
软件定义网络(Software-Defined Network, SDN)是一种新的网络架构,它采用了数据平面与控制平面解耦的思路,提供了网络架构发展的新方向。为了提升WSN的技术有效性,SDN架构被引入到WSN领域中,形成了新的软件定义...
QtNetwork QtNetworkvQtNetworkQtNetworkQtNetworkQtNetworkQtNetworkQtNetworkQtNetworkQtNetworkQtNetworkQtNetworkQtNetwork
Network In Network.zip
1.大致流程 2.频道(NetworkChannel) 3.连接服务器 4.频道辅助器(NetworkChannelHelper) 6.消息头(PacketHe
SDN(Software Defined Network)软件定义网络,字面释义都说了是软件来定义网络,但有心之人会想:这个软件到底是如何定义了我
Interfaces for the Optical Transport Network (OTN)光传送网(OTN)的接口
Software Defined Network 软件定义网络。高清英文原版无水印
ISO 17356-5:2006 Part 5:OSEK/VDX Network Management(NM) 该标准最后一次审查和确认是在2020年。因此,该版本仍然是最新的。 摘要 ISO 17356-5:2006定义了一组用于节点监控node monitoring(NM)的服务。NM由以下...
network Socket
3gpp2-cdma-A接口协议。3GPP2 Access Network Interfaces Interoperability 1 Specification