forked from netty/netty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[netty#917] Move transport depending ChannelOption to the specific tr…
…ansport to make it consistent
- Loading branch information
Norman Maurer
committed
Jan 16, 2013
1 parent
b7de868
commit 895bce6
Showing
14 changed files
with
134 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannelOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2013 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. | ||
*/ | ||
package io.netty.channel.sctp; | ||
|
||
import io.netty.channel.ChannelOption; | ||
|
||
import java.net.SocketAddress; | ||
import java.util.List; | ||
|
||
/** | ||
* Option for configuring the SCTP transport | ||
*/ | ||
public class SctpChannelOption<T> extends ChannelOption<T> { | ||
public static final ChannelOption<Boolean> SCTP_DISABLE_FRAGMENTS = | ||
new ChannelOption<Boolean>("SCTP_DISABLE_FRAGMENTS"); | ||
public static final ChannelOption<Boolean> SCTP_EXPLICIT_COMPLETE = | ||
new ChannelOption<Boolean>("SCTP_EXPLICIT_COMPLETE"); | ||
public static final ChannelOption<Integer> SCTP_FRAGMENT_INTERLEAVE = | ||
new ChannelOption<Integer>("SCTP_FRAGMENT_INTERLEAVE"); | ||
public static final ChannelOption<List<Integer>> SCTP_INIT_MAXSTREAMS = | ||
new ChannelOption<List<Integer>>("SCTP_INIT_MAXSTREAMS") { | ||
@Override | ||
public void validate(List<Integer> value) { | ||
super.validate(value); | ||
if (value.size() != 2) { | ||
throw new IllegalArgumentException("value must be a List of 2 Integers: " + value); | ||
} | ||
if (value.get(0) == null) { | ||
throw new NullPointerException("value[0]"); | ||
} | ||
if (value.get(1) == null) { | ||
throw new NullPointerException("value[1]"); | ||
} | ||
} | ||
}; | ||
|
||
public static final ChannelOption<Boolean> SCTP_NODELAY = | ||
new ChannelOption<Boolean>("SCTP_NODELAY"); | ||
public static final ChannelOption<SocketAddress> SCTP_PRIMARY_ADDR = | ||
new ChannelOption<SocketAddress>("SCTP_PRIMARY_ADDR"); | ||
public static final ChannelOption<SocketAddress> SCTP_SET_PEER_PRIMARY_ADDR = | ||
new ChannelOption<SocketAddress>("SCTP_SET_PEER_PRIMARY_ADDR"); | ||
|
||
public SctpChannelOption(String name) { | ||
super(name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
transport-udt/src/main/java/io/netty/channel/udt/UdtChannelOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2013 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. | ||
*/ | ||
package io.netty.channel.udt; | ||
|
||
import com.barchart.udt.OptionUDT; | ||
import io.netty.channel.ChannelOption; | ||
|
||
/** | ||
* Options for the UDT transport | ||
*/ | ||
public class UdtChannelOption<T> extends ChannelOption<T> { | ||
|
||
/** | ||
* See {@link OptionUDT#Protocol_Receive_Buffer_Size}. | ||
*/ | ||
public static final ChannelOption<Integer> PROTOCOL_RECEIVE_BUFFER_SIZE = new ChannelOption<Integer>( | ||
"PROTOCOL_RECEIVE_BUFFER_SIZE"); | ||
|
||
/** | ||
* See {@link OptionUDT#Protocol_Send_Buffer_Size}. | ||
*/ | ||
public static final ChannelOption<Integer> PROTOCOL_SEND_BUFFER_SIZE = new ChannelOption<Integer>( | ||
"PROTOCOL_SEND_BUFFER_SIZE"); | ||
|
||
/** | ||
* See {@link OptionUDT#System_Receive_Buffer_Size}. | ||
*/ | ||
public static final ChannelOption<Integer> SYSTEM_RECEIVE_BUFFER_SIZE = new ChannelOption<Integer>( | ||
"SYSTEM_RECEIVE_BUFFER_SIZE"); | ||
|
||
/** | ||
* See {@link OptionUDT#System_Send_Buffer_Size}. | ||
*/ | ||
public static final ChannelOption<Integer> SYSTEM_SEND_BUFFER_SIZE = new ChannelOption<Integer>( | ||
"SYSTEM_SEND_BUFFER_SIZE"); | ||
|
||
public UdtChannelOption(String name) { | ||
super(name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters