[#884] Split SCTP transport into extra module
This commit is contained in:
parent
37a3f2e3b8
commit
ccb5409f58
@ -34,6 +34,11 @@
|
|||||||
<artifactId>netty-transport</artifactId>
|
<artifactId>netty-transport</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>netty-transport-sctp</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
<artifactId>netty-handler</artifactId>
|
<artifactId>netty-handler</artifactId>
|
||||||
|
@ -19,9 +19,9 @@ import io.netty.bootstrap.Bootstrap;
|
|||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.socket.SctpChannel;
|
import io.netty.channel.socket.sctp.SctpChannel;
|
||||||
import io.netty.channel.socket.nio.NioEventLoopGroup;
|
import io.netty.channel.socket.nio.NioEventLoopGroup;
|
||||||
import io.netty.channel.socket.nio.NioSctpChannel;
|
import io.netty.channel.socket.sctp.nio.NioSctpChannel;
|
||||||
import io.netty.handler.logging.LogLevel;
|
import io.netty.handler.logging.LogLevel;
|
||||||
import io.netty.handler.logging.LoggingHandler;
|
import io.netty.handler.logging.LoggingHandler;
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@ import io.netty.bootstrap.ServerBootstrap;
|
|||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.socket.SctpChannel;
|
import io.netty.channel.socket.sctp.SctpChannel;
|
||||||
import io.netty.channel.socket.nio.NioEventLoopGroup;
|
import io.netty.channel.socket.nio.NioEventLoopGroup;
|
||||||
import io.netty.channel.socket.nio.NioSctpServerChannel;
|
import io.netty.channel.socket.sctp.nio.NioSctpServerChannel;
|
||||||
import io.netty.handler.logging.LogLevel;
|
import io.netty.handler.logging.LogLevel;
|
||||||
import io.netty.handler.logging.LoggingHandler;
|
import io.netty.handler.logging.LoggingHandler;
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@ import io.netty.bootstrap.Bootstrap;
|
|||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.socket.SctpChannel;
|
import io.netty.channel.socket.sctp.SctpChannel;
|
||||||
import io.netty.channel.socket.oio.OioEventLoopGroup;
|
import io.netty.channel.socket.oio.OioEventLoopGroup;
|
||||||
import io.netty.channel.socket.oio.OioSctpChannel;
|
import io.netty.channel.socket.sctp.oio.OioSctpChannel;
|
||||||
import io.netty.handler.logging.LogLevel;
|
import io.netty.handler.logging.LogLevel;
|
||||||
import io.netty.handler.logging.LoggingHandler;
|
import io.netty.handler.logging.LoggingHandler;
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@ import io.netty.bootstrap.ServerBootstrap;
|
|||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
import io.netty.channel.ChannelOption;
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.socket.SctpChannel;
|
import io.netty.channel.socket.sctp.SctpChannel;
|
||||||
import io.netty.channel.socket.oio.OioEventLoopGroup;
|
import io.netty.channel.socket.oio.OioEventLoopGroup;
|
||||||
import io.netty.channel.socket.oio.OioSctpServerChannel;
|
import io.netty.channel.socket.sctp.oio.OioSctpServerChannel;
|
||||||
import io.netty.handler.logging.LogLevel;
|
import io.netty.handler.logging.LogLevel;
|
||||||
import io.netty.handler.logging.LoggingHandler;
|
import io.netty.handler.logging.LoggingHandler;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import io.netty.buffer.MessageBuf;
|
|||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
|
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
|
||||||
import io.netty.channel.socket.SctpMessage;
|
import io.netty.channel.socket.sctp.SctpMessage;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
@ -19,7 +19,7 @@ import io.netty.buffer.MessageBuf;
|
|||||||
import io.netty.channel.ChannelHandler.Sharable;
|
import io.netty.channel.ChannelHandler.Sharable;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
|
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
|
||||||
import io.netty.channel.socket.SctpMessage;
|
import io.netty.channel.socket.sctp.SctpMessage;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
1
pom.xml
1
pom.xml
@ -79,6 +79,7 @@
|
|||||||
<module>codec-http</module>
|
<module>codec-http</module>
|
||||||
<module>codec-socks</module>
|
<module>codec-socks</module>
|
||||||
<module>transport</module>
|
<module>transport</module>
|
||||||
|
<module>transport-sctp</module>
|
||||||
<module>handler</module>
|
<module>handler</module>
|
||||||
<module>metrics-yammer</module>
|
<module>metrics-yammer</module>
|
||||||
<module>example</module>
|
<module>example</module>
|
||||||
|
@ -29,6 +29,11 @@
|
|||||||
<name>Netty/Testsuite</name>
|
<name>Netty/Testsuite</name>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>netty-transport-sctp</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
<artifactId>netty-handler</artifactId>
|
<artifactId>netty-handler</artifactId>
|
||||||
|
@ -23,13 +23,12 @@ import io.netty.channel.Channel;
|
|||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelInboundByteHandlerAdapter;
|
import io.netty.channel.ChannelInboundByteHandlerAdapter;
|
||||||
import io.netty.channel.ChannelInitializer;
|
import io.netty.channel.ChannelInitializer;
|
||||||
import io.netty.channel.socket.SctpChannel;
|
import io.netty.channel.socket.sctp.SctpChannel;
|
||||||
import io.netty.handler.codec.sctp.SctpInboundByteStreamHandler;
|
import io.netty.handler.codec.sctp.SctpInboundByteStreamHandler;
|
||||||
import io.netty.handler.codec.sctp.SctpMessageCompletionHandler;
|
import io.netty.handler.codec.sctp.SctpMessageCompletionHandler;
|
||||||
import io.netty.handler.codec.sctp.SctpOutboundByteStreamHandler;
|
import io.netty.handler.codec.sctp.SctpOutboundByteStreamHandler;
|
||||||
import io.netty.testsuite.util.TestUtils;
|
import io.netty.testsuite.util.TestUtils;
|
||||||
import org.junit.Assume;
|
import org.junit.Assume;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -25,14 +25,14 @@ import io.netty.channel.socket.aio.AioServerSocketChannel;
|
|||||||
import io.netty.channel.socket.aio.AioSocketChannel;
|
import io.netty.channel.socket.aio.AioSocketChannel;
|
||||||
import io.netty.channel.socket.nio.NioDatagramChannel;
|
import io.netty.channel.socket.nio.NioDatagramChannel;
|
||||||
import io.netty.channel.socket.nio.NioEventLoopGroup;
|
import io.netty.channel.socket.nio.NioEventLoopGroup;
|
||||||
import io.netty.channel.socket.nio.NioSctpChannel;
|
import io.netty.channel.socket.sctp.nio.NioSctpChannel;
|
||||||
import io.netty.channel.socket.nio.NioSctpServerChannel;
|
import io.netty.channel.socket.sctp.nio.NioSctpServerChannel;
|
||||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||||
import io.netty.channel.socket.nio.NioSocketChannel;
|
import io.netty.channel.socket.nio.NioSocketChannel;
|
||||||
import io.netty.channel.socket.oio.OioDatagramChannel;
|
import io.netty.channel.socket.oio.OioDatagramChannel;
|
||||||
import io.netty.channel.socket.oio.OioEventLoopGroup;
|
import io.netty.channel.socket.oio.OioEventLoopGroup;
|
||||||
import io.netty.channel.socket.oio.OioSctpChannel;
|
import io.netty.channel.socket.sctp.oio.OioSctpChannel;
|
||||||
import io.netty.channel.socket.oio.OioSctpServerChannel;
|
import io.netty.channel.socket.sctp.oio.OioSctpServerChannel;
|
||||||
import io.netty.channel.socket.oio.OioServerSocketChannel;
|
import io.netty.channel.socket.oio.OioServerSocketChannel;
|
||||||
import io.netty.channel.socket.oio.OioSocketChannel;
|
import io.netty.channel.socket.oio.OioSocketChannel;
|
||||||
import io.netty.testsuite.util.TestUtils;
|
import io.netty.testsuite.util.TestUtils;
|
||||||
|
68
transport-sctp/pom.xml
Normal file
68
transport-sctp/pom.xml
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright 2012 The Netty Project
|
||||||
|
~
|
||||||
|
~ The Netty Project licenses this file to you under the Apache License,
|
||||||
|
~ version 2.0 (the "License"); you may not use this file except in compliance
|
||||||
|
~ with the License. You may obtain a copy of the License at:
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
~ License for the specific language governing permissions and limitations
|
||||||
|
~ under the License.
|
||||||
|
-->
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>io.netty</groupId>
|
||||||
|
<artifactId>netty-parent</artifactId>
|
||||||
|
<version>4.0.0.Beta1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>netty-transport-sctp</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>Netty/SCTP Transport</name>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>netty-buffer</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>netty-codec</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>netty-transport</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<!-- dont want to include com.sun in here -->
|
||||||
|
<exclude>com/**</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
</plugins>
|
||||||
|
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket;
|
package io.netty.channel.socket.sctp;
|
||||||
|
|
||||||
import com.sun.nio.sctp.SctpChannel;
|
import com.sun.nio.sctp.SctpChannel;
|
||||||
import com.sun.nio.sctp.SctpStandardSocketOptions;
|
import com.sun.nio.sctp.SctpStandardSocketOptions;
|
||||||
@ -34,7 +34,7 @@ public class DefaultSctpChannelConfig extends DefaultChannelConfig implements Sc
|
|||||||
|
|
||||||
private final SctpChannel javaChannel;
|
private final SctpChannel javaChannel;
|
||||||
|
|
||||||
public DefaultSctpChannelConfig(io.netty.channel.socket.SctpChannel channel, SctpChannel javaChannel) {
|
public DefaultSctpChannelConfig(io.netty.channel.socket.sctp.SctpChannel channel, SctpChannel javaChannel) {
|
||||||
super(channel);
|
super(channel);
|
||||||
if (javaChannel == null) {
|
if (javaChannel == null) {
|
||||||
throw new NullPointerException("javaChannel");
|
throw new NullPointerException("javaChannel");
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket;
|
package io.netty.channel.socket.sctp;
|
||||||
|
|
||||||
import com.sun.nio.sctp.SctpServerChannel;
|
import com.sun.nio.sctp.SctpServerChannel;
|
||||||
import io.netty.buffer.ByteBufAllocator;
|
import io.netty.buffer.ByteBufAllocator;
|
||||||
@ -39,7 +39,7 @@ public class DefaultSctpServerChannelConfig extends DefaultChannelConfig impleme
|
|||||||
* Creates a new instance.
|
* Creates a new instance.
|
||||||
*/
|
*/
|
||||||
public DefaultSctpServerChannelConfig(
|
public DefaultSctpServerChannelConfig(
|
||||||
io.netty.channel.socket.SctpServerChannel channel, SctpServerChannel javaChannel) {
|
io.netty.channel.socket.sctp.SctpServerChannel channel, SctpServerChannel javaChannel) {
|
||||||
super(channel);
|
super(channel);
|
||||||
if (javaChannel == null) {
|
if (javaChannel == null) {
|
||||||
throw new NullPointerException("javaChannel");
|
throw new NullPointerException("javaChannel");
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket;
|
package io.netty.channel.socket.sctp;
|
||||||
|
|
||||||
import com.sun.nio.sctp.Association;
|
import com.sun.nio.sctp.Association;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket;
|
package io.netty.channel.socket.sctp;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBufAllocator;
|
import io.netty.buffer.ByteBufAllocator;
|
||||||
import io.netty.channel.ChannelConfig;
|
import io.netty.channel.ChannelConfig;
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket;
|
package io.netty.channel.socket.sctp;
|
||||||
|
|
||||||
import com.sun.nio.sctp.MessageInfo;
|
import com.sun.nio.sctp.MessageInfo;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket;
|
package io.netty.channel.socket.sctp;
|
||||||
|
|
||||||
import com.sun.nio.sctp.Notification;
|
import com.sun.nio.sctp.Notification;
|
||||||
import io.netty.channel.ChannelHandler;
|
import io.netty.channel.ChannelHandler;
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket;
|
package io.netty.channel.socket.sctp;
|
||||||
|
|
||||||
import com.sun.nio.sctp.AbstractNotificationHandler;
|
import com.sun.nio.sctp.AbstractNotificationHandler;
|
||||||
import com.sun.nio.sctp.AssociationChangeNotification;
|
import com.sun.nio.sctp.AssociationChangeNotification;
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket;
|
package io.netty.channel.socket.sctp;
|
||||||
|
|
||||||
import io.netty.channel.ServerChannel;
|
import io.netty.channel.ServerChannel;
|
||||||
|
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket;
|
package io.netty.channel.socket.sctp;
|
||||||
|
|
||||||
import io.netty.buffer.ByteBufAllocator;
|
import io.netty.buffer.ByteBufAllocator;
|
||||||
import io.netty.channel.ChannelConfig;
|
import io.netty.channel.ChannelConfig;
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket.nio;
|
package io.netty.channel.socket.sctp.nio;
|
||||||
|
|
||||||
import com.sun.nio.sctp.Association;
|
import com.sun.nio.sctp.Association;
|
||||||
import com.sun.nio.sctp.MessageInfo;
|
import com.sun.nio.sctp.MessageInfo;
|
||||||
@ -27,10 +27,11 @@ import io.netty.channel.ChannelException;
|
|||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelMetadata;
|
import io.netty.channel.ChannelMetadata;
|
||||||
import io.netty.channel.ChannelPromise;
|
import io.netty.channel.ChannelPromise;
|
||||||
import io.netty.channel.socket.DefaultSctpChannelConfig;
|
import io.netty.channel.socket.nio.AbstractNioMessageChannel;
|
||||||
import io.netty.channel.socket.SctpChannelConfig;
|
import io.netty.channel.socket.sctp.DefaultSctpChannelConfig;
|
||||||
import io.netty.channel.socket.SctpMessage;
|
import io.netty.channel.socket.sctp.SctpChannelConfig;
|
||||||
import io.netty.channel.socket.SctpNotificationHandler;
|
import io.netty.channel.socket.sctp.SctpMessage;
|
||||||
|
import io.netty.channel.socket.sctp.SctpNotificationHandler;
|
||||||
import io.netty.logging.InternalLogger;
|
import io.netty.logging.InternalLogger;
|
||||||
import io.netty.logging.InternalLoggerFactory;
|
import io.netty.logging.InternalLoggerFactory;
|
||||||
|
|
||||||
@ -45,13 +46,13 @@ import java.util.Iterator;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link io.netty.channel.socket.SctpChannel} implementation which use non-blocking mode and allows to read / write
|
* {@link io.netty.channel.socket.sctp.SctpChannel} implementation which use non-blocking mode and allows to read /
|
||||||
* {@link SctpMessage}s to the underlying {@link SctpChannel}.
|
* write {@link SctpMessage}s to the underlying {@link SctpChannel}.
|
||||||
*
|
*
|
||||||
* Be aware that not all operations systems support SCTP. Please refer to the documentation of your operation system,
|
* Be aware that not all operations systems support SCTP. Please refer to the documentation of your operation system,
|
||||||
* to understand what you need to do to use it. Also this feature is only supported on Java 7+.
|
* to understand what you need to do to use it. Also this feature is only supported on Java 7+.
|
||||||
*/
|
*/
|
||||||
public class NioSctpChannel extends AbstractNioMessageChannel implements io.netty.channel.socket.SctpChannel {
|
public class NioSctpChannel extends AbstractNioMessageChannel implements io.netty.channel.socket.sctp.SctpChannel {
|
||||||
private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
|
private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
|
||||||
|
|
||||||
private static final InternalLogger logger = InternalLoggerFactory.getInstance(NioSctpChannel.class);
|
private static final InternalLogger logger = InternalLoggerFactory.getInstance(NioSctpChannel.class);
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket.nio;
|
package io.netty.channel.socket.sctp.nio;
|
||||||
|
|
||||||
import com.sun.nio.sctp.SctpChannel;
|
import com.sun.nio.sctp.SctpChannel;
|
||||||
import com.sun.nio.sctp.SctpServerChannel;
|
import com.sun.nio.sctp.SctpServerChannel;
|
||||||
@ -21,8 +21,9 @@ import io.netty.buffer.BufType;
|
|||||||
import io.netty.buffer.MessageBuf;
|
import io.netty.buffer.MessageBuf;
|
||||||
import io.netty.channel.ChannelException;
|
import io.netty.channel.ChannelException;
|
||||||
import io.netty.channel.ChannelMetadata;
|
import io.netty.channel.ChannelMetadata;
|
||||||
import io.netty.channel.socket.DefaultSctpServerChannelConfig;
|
import io.netty.channel.socket.nio.AbstractNioMessageChannel;
|
||||||
import io.netty.channel.socket.SctpServerChannelConfig;
|
import io.netty.channel.socket.sctp.DefaultSctpServerChannelConfig;
|
||||||
|
import io.netty.channel.socket.sctp.SctpServerChannelConfig;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
@ -34,14 +35,14 @@ import java.util.Iterator;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link io.netty.channel.socket.SctpServerChannel} implementation which use non-blocking mode to accept new
|
* {@link io.netty.channel.socket.sctp.SctpServerChannel} implementation which use non-blocking mode to accept new
|
||||||
* connections and create the {@link NioSctpChannel} for them.
|
* connections and create the {@link NioSctpChannel} for them.
|
||||||
*
|
*
|
||||||
* Be aware that not all operations systems support SCTP. Please refer to the documentation of your operation system,
|
* Be aware that not all operations systems support SCTP. Please refer to the documentation of your operation system,
|
||||||
* to understand what you need to do to use it. Also this feature is only supported on Java 7+.
|
* to understand what you need to do to use it. Also this feature is only supported on Java 7+.
|
||||||
*/
|
*/
|
||||||
public class NioSctpServerChannel extends AbstractNioMessageChannel
|
public class NioSctpServerChannel extends AbstractNioMessageChannel
|
||||||
implements io.netty.channel.socket.SctpServerChannel {
|
implements io.netty.channel.socket.sctp.SctpServerChannel {
|
||||||
private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
|
private static final ChannelMetadata METADATA = new ChannelMetadata(BufType.MESSAGE, false);
|
||||||
|
|
||||||
private static SctpServerChannel newSocket() {
|
private static SctpServerChannel newSocket() {
|
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 The Netty Project
|
||||||
|
*
|
||||||
|
* The Netty Project licenses this file to you under the Apache License,
|
||||||
|
* version 2.0 (the "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <a href="http://en.wikipedia.org/wiki/New_I/O">NIO</a>-based SCTP Channel
|
||||||
|
* API implementation - recommended for a large number of connections (>= 1000).
|
||||||
|
*/
|
||||||
|
package io.netty.channel.socket.sctp.nio;
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket.oio;
|
package io.netty.channel.socket.sctp.oio;
|
||||||
|
|
||||||
import com.sun.nio.sctp.Association;
|
import com.sun.nio.sctp.Association;
|
||||||
import com.sun.nio.sctp.MessageInfo;
|
import com.sun.nio.sctp.MessageInfo;
|
||||||
@ -27,10 +27,11 @@ import io.netty.channel.ChannelException;
|
|||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
import io.netty.channel.ChannelMetadata;
|
import io.netty.channel.ChannelMetadata;
|
||||||
import io.netty.channel.ChannelPromise;
|
import io.netty.channel.ChannelPromise;
|
||||||
import io.netty.channel.socket.DefaultSctpChannelConfig;
|
import io.netty.channel.socket.oio.AbstractOioMessageChannel;
|
||||||
import io.netty.channel.socket.SctpChannelConfig;
|
import io.netty.channel.socket.sctp.DefaultSctpChannelConfig;
|
||||||
import io.netty.channel.socket.SctpMessage;
|
import io.netty.channel.socket.sctp.SctpChannelConfig;
|
||||||
import io.netty.channel.socket.SctpNotificationHandler;
|
import io.netty.channel.socket.sctp.SctpMessage;
|
||||||
|
import io.netty.channel.socket.sctp.SctpNotificationHandler;
|
||||||
import io.netty.logging.InternalLogger;
|
import io.netty.logging.InternalLogger;
|
||||||
import io.netty.logging.InternalLoggerFactory;
|
import io.netty.logging.InternalLoggerFactory;
|
||||||
|
|
||||||
@ -46,14 +47,14 @@ import java.util.Iterator;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link io.netty.channel.socket.SctpChannel} implementation which use blocking mode and allows to read / write
|
* {@link io.netty.channel.socket.sctp.SctpChannel} implementation which use blocking mode and allows to read / write
|
||||||
* {@link SctpMessage}s to the underlying {@link SctpChannel}.
|
* {@link SctpMessage}s to the underlying {@link SctpChannel}.
|
||||||
*
|
*
|
||||||
* Be aware that not all operations systems support SCTP. Please refer to the documentation of your operation system,
|
* Be aware that not all operations systems support SCTP. Please refer to the documentation of your operation system,
|
||||||
* to understand what you need to do to use it. Also this feature is only supported on Java 7+.
|
* to understand what you need to do to use it. Also this feature is only supported on Java 7+.
|
||||||
*/
|
*/
|
||||||
public class OioSctpChannel extends AbstractOioMessageChannel
|
public class OioSctpChannel extends AbstractOioMessageChannel
|
||||||
implements io.netty.channel.socket.SctpChannel {
|
implements io.netty.channel.socket.sctp.SctpChannel {
|
||||||
|
|
||||||
private static final InternalLogger logger =
|
private static final InternalLogger logger =
|
||||||
InternalLoggerFactory.getInstance(OioSctpChannel.class);
|
InternalLoggerFactory.getInstance(OioSctpChannel.class);
|
@ -13,7 +13,7 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
package io.netty.channel.socket.oio;
|
package io.netty.channel.socket.sctp.oio;
|
||||||
|
|
||||||
import com.sun.nio.sctp.SctpChannel;
|
import com.sun.nio.sctp.SctpChannel;
|
||||||
import com.sun.nio.sctp.SctpServerChannel;
|
import com.sun.nio.sctp.SctpServerChannel;
|
||||||
@ -21,8 +21,9 @@ import io.netty.buffer.BufType;
|
|||||||
import io.netty.buffer.MessageBuf;
|
import io.netty.buffer.MessageBuf;
|
||||||
import io.netty.channel.ChannelException;
|
import io.netty.channel.ChannelException;
|
||||||
import io.netty.channel.ChannelMetadata;
|
import io.netty.channel.ChannelMetadata;
|
||||||
import io.netty.channel.socket.DefaultSctpServerChannelConfig;
|
import io.netty.channel.socket.sctp.DefaultSctpServerChannelConfig;
|
||||||
import io.netty.channel.socket.SctpServerChannelConfig;
|
import io.netty.channel.socket.sctp.SctpServerChannelConfig;
|
||||||
|
import io.netty.channel.socket.oio.AbstractOioMessageChannel;
|
||||||
import io.netty.logging.InternalLogger;
|
import io.netty.logging.InternalLogger;
|
||||||
import io.netty.logging.InternalLoggerFactory;
|
import io.netty.logging.InternalLoggerFactory;
|
||||||
|
|
||||||
@ -37,14 +38,14 @@ import java.util.Iterator;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link io.netty.channel.socket.SctpServerChannel} implementation which use blocking mode to accept new connections
|
* {@link io.netty.channel.socket.sctp.SctpServerChannel} implementation which use blocking mode to accept new
|
||||||
* and create the {@link OioSctpChannel} for them.
|
* connections and create the {@link OioSctpChannel} for them.
|
||||||
*
|
*
|
||||||
* Be aware that not all operations systems support SCTP. Please refer to the documentation of your operation system,
|
* Be aware that not all operations systems support SCTP. Please refer to the documentation of your operation system,
|
||||||
* to understand what you need to do to use it. Also this feature is only supported on Java 7+.
|
* to understand what you need to do to use it. Also this feature is only supported on Java 7+.
|
||||||
*/
|
*/
|
||||||
public class OioSctpServerChannel extends AbstractOioMessageChannel
|
public class OioSctpServerChannel extends AbstractOioMessageChannel
|
||||||
implements io.netty.channel.socket.SctpServerChannel {
|
implements io.netty.channel.socket.sctp.SctpServerChannel {
|
||||||
|
|
||||||
private static final InternalLogger logger =
|
private static final InternalLogger logger =
|
||||||
InternalLoggerFactory.getInstance(OioSctpServerChannel.class);
|
InternalLoggerFactory.getInstance(OioSctpServerChannel.class);
|
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 The Netty Project
|
||||||
|
*
|
||||||
|
* The Netty Project licenses this file to you under the Apache License,
|
||||||
|
* version 2.0 (the "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Old blocking I/O based SCTP channel API implementation - recommended for
|
||||||
|
* a small number of connections (< 1000).
|
||||||
|
*/
|
||||||
|
package io.netty.channel.socket.sctp.oio;
|
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 The Netty Project
|
||||||
|
*
|
||||||
|
* The Netty Project licenses this file to you under the Apache License,
|
||||||
|
* version 2.0 (the "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations
|
||||||
|
* under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract SCTP socket interfaces which extend the core channel API.
|
||||||
|
*
|
||||||
|
* @apiviz.exclude \.(Abstract|Default).*$
|
||||||
|
* @apiviz.exclude \.socket\.[a-z]+\.
|
||||||
|
* @apiviz.exclude \.channel\.[A-Z]
|
||||||
|
*/
|
||||||
|
package io.netty.channel.socket.sctp;
|
@ -19,7 +19,7 @@ package io.netty.handler.codec.sctp;
|
|||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
|
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
|
||||||
import io.netty.channel.socket.SctpMessage;
|
import io.netty.channel.socket.sctp.SctpMessage;
|
||||||
import io.netty.handler.codec.CodecException;
|
import io.netty.handler.codec.CodecException;
|
||||||
|
|
||||||
/**
|
/**
|
@ -21,7 +21,7 @@ import io.netty.buffer.Unpooled;
|
|||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelInboundMessageHandler;
|
import io.netty.channel.ChannelInboundMessageHandler;
|
||||||
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
|
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
|
||||||
import io.netty.channel.socket.SctpMessage;
|
import io.netty.channel.socket.sctp.SctpMessage;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package io.netty.handler.codec.sctp;
|
package io.netty.handler.codec.sctp;
|
||||||
|
|
||||||
import io.netty.channel.socket.SctpMessage;
|
import io.netty.channel.socket.sctp.SctpMessage;
|
||||||
import io.netty.handler.codec.CodecException;
|
import io.netty.handler.codec.CodecException;
|
||||||
import io.netty.handler.codec.MessageToMessageDecoder;
|
import io.netty.handler.codec.MessageToMessageDecoder;
|
||||||
|
|
@ -21,7 +21,7 @@ import io.netty.buffer.Unpooled;
|
|||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelOutboundByteHandlerAdapter;
|
import io.netty.channel.ChannelOutboundByteHandlerAdapter;
|
||||||
import io.netty.channel.ChannelPromise;
|
import io.netty.channel.ChannelPromise;
|
||||||
import io.netty.channel.socket.SctpMessage;
|
import io.netty.channel.socket.sctp.SctpMessage;
|
||||||
import io.netty.handler.codec.EncoderException;
|
import io.netty.handler.codec.EncoderException;
|
||||||
|
|
||||||
/**
|
/**
|
@ -36,23 +36,5 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<excludes>
|
|
||||||
<!-- dont want to include com.sun in here -->
|
|
||||||
<exclude>com/**</exclude>
|
|
||||||
</excludes>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
</plugins>
|
|
||||||
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import java.io.IOException;
|
|||||||
/**
|
/**
|
||||||
* Abstract base class for OIO which reads and writes bytes from/to a Socket
|
* Abstract base class for OIO which reads and writes bytes from/to a Socket
|
||||||
*/
|
*/
|
||||||
abstract class AbstractOioByteChannel extends AbstractOioChannel {
|
public abstract class AbstractOioByteChannel extends AbstractOioChannel {
|
||||||
|
|
||||||
private volatile boolean inputShutdown;
|
private volatile boolean inputShutdown;
|
||||||
|
|
||||||
|
@ -26,9 +26,9 @@ import java.net.SocketAddress;
|
|||||||
/**
|
/**
|
||||||
* Abstract base class for {@link Channel} implementations that use Old-Blocking-IO
|
* Abstract base class for {@link Channel} implementations that use Old-Blocking-IO
|
||||||
*/
|
*/
|
||||||
abstract class AbstractOioChannel extends AbstractChannel {
|
public abstract class AbstractOioChannel extends AbstractChannel {
|
||||||
|
|
||||||
static final int SO_TIMEOUT = 1000;
|
protected static final int SO_TIMEOUT = 1000;
|
||||||
|
|
||||||
private boolean readInProgress;
|
private boolean readInProgress;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import java.io.IOException;
|
|||||||
/**
|
/**
|
||||||
* Abstract base class for OIO which reads and writes objects from/to a Socket
|
* Abstract base class for OIO which reads and writes objects from/to a Socket
|
||||||
*/
|
*/
|
||||||
abstract class AbstractOioMessageChannel extends AbstractOioChannel {
|
public abstract class AbstractOioMessageChannel extends AbstractOioChannel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AbstractOioChannel#AbstractOioChannel(Channel, Integer)
|
* @see AbstractOioChannel#AbstractOioChannel(Channel, Integer)
|
||||||
|
Loading…
Reference in New Issue
Block a user