feat(jdk8): move files to new folder to avoid resources compiled.
This commit is contained in:
170
jdkSrc/jdk8/sun/nio/ch/sctp/MessageInfoImpl.java
Normal file
170
jdkSrc/jdk8/sun/nio/ch/sctp/MessageInfoImpl.java
Normal file
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package sun.nio.ch.sctp;
|
||||
|
||||
import java.net.SocketAddress;
|
||||
import com.sun.nio.sctp.MessageInfo;
|
||||
import com.sun.nio.sctp.Association;
|
||||
|
||||
/**
|
||||
* An implementation of a MessageInfo.
|
||||
*/
|
||||
public class MessageInfoImpl extends MessageInfo {
|
||||
private final SocketAddress address;
|
||||
private final int bytes; /* 0 */
|
||||
|
||||
private Association association;
|
||||
private int assocId;
|
||||
private int streamNumber;
|
||||
private boolean complete = true;
|
||||
private boolean unordered; /* false */
|
||||
private long timeToLive; /* 0L */
|
||||
private int ppid; /* 0 */
|
||||
|
||||
public MessageInfoImpl(Association association,
|
||||
SocketAddress address,
|
||||
int streamNumber) {
|
||||
this.association = association;
|
||||
this.address = address;
|
||||
this.streamNumber = streamNumber;
|
||||
bytes = 0;
|
||||
}
|
||||
|
||||
/* Invoked from native */
|
||||
private MessageInfoImpl(int assocId,
|
||||
SocketAddress address,
|
||||
int bytes,
|
||||
int streamNumber,
|
||||
boolean complete,
|
||||
boolean unordered,
|
||||
int ppid) {
|
||||
this.assocId = assocId;
|
||||
this.address = address;
|
||||
this.bytes = bytes;
|
||||
this.streamNumber = streamNumber;
|
||||
this.complete = complete;
|
||||
this.unordered = unordered;
|
||||
this.ppid = ppid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Association association() {
|
||||
return association;
|
||||
}
|
||||
|
||||
/**
|
||||
* MessageInfoImpl instances created from native will need to have their
|
||||
* association set from the channel.
|
||||
*/
|
||||
void setAssociation(Association association) {
|
||||
this.association = association;
|
||||
}
|
||||
|
||||
int associationID() {
|
||||
return assocId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SocketAddress address() {
|
||||
return address;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bytes() {
|
||||
return bytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int streamNumber() {
|
||||
return streamNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageInfo streamNumber(int streamNumber) {
|
||||
if (streamNumber < 0 || streamNumber > 65536)
|
||||
throw new IllegalArgumentException("Invalid stream number");
|
||||
|
||||
this.streamNumber = streamNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int payloadProtocolID() {
|
||||
return ppid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageInfo payloadProtocolID(int ppid) {
|
||||
this.ppid = ppid;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageInfo complete(boolean complete) {
|
||||
this.complete = complete;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUnordered() {
|
||||
return unordered;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageInfo unordered(boolean unordered) {
|
||||
this.unordered = unordered;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long timeToLive() {
|
||||
return timeToLive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageInfo timeToLive(long millis) {
|
||||
timeToLive = millis;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder(super.toString());
|
||||
sb.append( "[Address: ").append(address)
|
||||
.append(", Association: ").append(association)
|
||||
.append(", Assoc ID: ").append(assocId)
|
||||
.append(", Bytes: ").append(bytes)
|
||||
.append(", Stream Number: ").append(streamNumber)
|
||||
.append(", Complete: ").append(complete)
|
||||
.append(", isUnordered: ").append(unordered)
|
||||
.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
150
jdkSrc/jdk8/sun/nio/ch/sctp/SctpChannelImpl.java
Normal file
150
jdkSrc/jdk8/sun/nio/ch/sctp/SctpChannelImpl.java
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package sun.nio.ch.sctp;
|
||||
|
||||
import java.net.SocketAddress;
|
||||
import java.net.InetAddress;
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.spi.SelectorProvider;
|
||||
import com.sun.nio.sctp.Association;
|
||||
import com.sun.nio.sctp.MessageInfo;
|
||||
import com.sun.nio.sctp.NotificationHandler;
|
||||
import com.sun.nio.sctp.SctpChannel;
|
||||
import com.sun.nio.sctp.SctpSocketOption;
|
||||
|
||||
/**
|
||||
* Unimplemented.
|
||||
*/
|
||||
public class SctpChannelImpl extends SctpChannel
|
||||
{
|
||||
private static final String message = "SCTP not supported on this platform";
|
||||
|
||||
public SctpChannelImpl(SelectorProvider provider) {
|
||||
super(provider);
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Association association() {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpChannel bind(SocketAddress local)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpChannel bindAddress(InetAddress address)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpChannel unbindAddress(InetAddress address)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean connect(SocketAddress remote) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean connect(SocketAddress remote, int maxOutStreams,
|
||||
int maxInStreams) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnectionPending() {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean finishConnect() throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<SocketAddress> getAllLocalAddresses()
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<SocketAddress> getRemoteAddresses()
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpChannel shutdown() throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getOption(SctpSocketOption<T> name)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> SctpChannel setOption(SctpSocketOption<T> name, T value)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<SctpSocketOption<?>> supportedOptions() {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> MessageInfo receive(ByteBuffer dst, T attachment,
|
||||
NotificationHandler<T> handler) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int send(ByteBuffer src, MessageInfo messageInfo)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void implConfigureBlocking(boolean block) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void implCloseSelectableChannel() throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
}
|
||||
137
jdkSrc/jdk8/sun/nio/ch/sctp/SctpMultiChannelImpl.java
Normal file
137
jdkSrc/jdk8/sun/nio/ch/sctp/SctpMultiChannelImpl.java
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package sun.nio.ch.sctp;
|
||||
|
||||
import java.net.SocketAddress;
|
||||
import java.net.InetAddress;
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.spi.SelectorProvider;
|
||||
import com.sun.nio.sctp.Association;
|
||||
import com.sun.nio.sctp.SctpChannel;
|
||||
import com.sun.nio.sctp.MessageInfo;
|
||||
import com.sun.nio.sctp.NotificationHandler;
|
||||
import com.sun.nio.sctp.SctpMultiChannel;
|
||||
import com.sun.nio.sctp.SctpSocketOption;
|
||||
|
||||
/**
|
||||
* Unimplemented.
|
||||
*/
|
||||
public class SctpMultiChannelImpl extends SctpMultiChannel
|
||||
{
|
||||
private static final String message = "SCTP not supported on this platform";
|
||||
|
||||
public SctpMultiChannelImpl(SelectorProvider provider) {
|
||||
super(provider);
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Association> associations() {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpMultiChannel bind(SocketAddress local,
|
||||
int backlog) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpMultiChannel bindAddress(InetAddress address)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpMultiChannel unbindAddress(InetAddress address)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<SocketAddress> getAllLocalAddresses()
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<SocketAddress> getRemoteAddresses
|
||||
(Association association) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpMultiChannel shutdown(Association association)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getOption(SctpSocketOption<T> name,
|
||||
Association association) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> SctpMultiChannel setOption(SctpSocketOption<T> name,
|
||||
T value, Association association) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<SctpSocketOption<?>> supportedOptions() {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> MessageInfo receive(ByteBuffer buffer, T attachment,
|
||||
NotificationHandler<T> handler) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int send(ByteBuffer buffer, MessageInfo messageInfo)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpChannel branch(Association association)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void implConfigureBlocking(boolean block) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void implCloseSelectableChannel() throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
}
|
||||
102
jdkSrc/jdk8/sun/nio/ch/sctp/SctpServerChannelImpl.java
Normal file
102
jdkSrc/jdk8/sun/nio/ch/sctp/SctpServerChannelImpl.java
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package sun.nio.ch.sctp;
|
||||
|
||||
import java.net.SocketAddress;
|
||||
import java.net.InetAddress;
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
import java.nio.channels.spi.SelectorProvider;
|
||||
import com.sun.nio.sctp.SctpChannel;
|
||||
import com.sun.nio.sctp.SctpServerChannel;
|
||||
import com.sun.nio.sctp.SctpSocketOption;
|
||||
|
||||
/**
|
||||
* Unimplemented.
|
||||
*/
|
||||
public class SctpServerChannelImpl extends SctpServerChannel
|
||||
{
|
||||
private static final String message = "SCTP not supported on this platform";
|
||||
|
||||
public SctpServerChannelImpl(SelectorProvider provider) {
|
||||
super(provider);
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpChannel accept() throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpServerChannel bind(SocketAddress local,
|
||||
int backlog) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpServerChannel bindAddress(InetAddress address)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SctpServerChannel unbindAddress(InetAddress address)
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<SocketAddress> getAllLocalAddresses()
|
||||
throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getOption(SctpSocketOption<T> name) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> SctpServerChannel setOption(SctpSocketOption<T> name,
|
||||
T value) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<SctpSocketOption<?>> supportedOptions() {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void implConfigureBlocking(boolean block) throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void implCloseSelectableChannel() throws IOException {
|
||||
throw new UnsupportedOperationException(message);
|
||||
}
|
||||
}
|
||||
77
jdkSrc/jdk8/sun/nio/ch/sctp/SctpStdSocketOption.java
Normal file
77
jdkSrc/jdk8/sun/nio/ch/sctp/SctpStdSocketOption.java
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package sun.nio.ch.sctp;
|
||||
|
||||
import com.sun.nio.sctp.SctpSocketOption;
|
||||
import java.lang.annotation.Native;
|
||||
|
||||
public class SctpStdSocketOption<T>
|
||||
implements SctpSocketOption<T>
|
||||
{
|
||||
/* for native mapping of int options */
|
||||
@Native public static final int SCTP_DISABLE_FRAGMENTS = 1;
|
||||
@Native public static final int SCTP_EXPLICIT_COMPLETE = 2;
|
||||
@Native public static final int SCTP_FRAGMENT_INTERLEAVE = 3;
|
||||
@Native public static final int SCTP_NODELAY = 4;
|
||||
@Native public static final int SO_SNDBUF = 5;
|
||||
@Native public static final int SO_RCVBUF = 6;
|
||||
@Native public static final int SO_LINGER = 7;
|
||||
|
||||
private final String name;
|
||||
private final Class<T> type;
|
||||
|
||||
/* for native mapping of int options */
|
||||
private int constValue;
|
||||
|
||||
public SctpStdSocketOption(String name, Class<T> type) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public SctpStdSocketOption(String name, Class<T> type, int constValue) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.constValue = constValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<T> type() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
int constValue() {
|
||||
return constValue;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user