当前位置: 首页>>代码示例>>Java>>正文


Java SdpSupport类代码示例

本文整理汇总了Java中sun.net.sdp.SdpSupport的典型用法代码示例。如果您正苦于以下问题:Java SdpSupport类的具体用法?Java SdpSupport怎么用?Java SdpSupport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SdpSupport类属于sun.net.sdp包,在下文中一共展示了SdpSupport类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convertTcpToSdpIfMatch

import sun.net.sdp.SdpSupport; //导入依赖的package包/类
private void convertTcpToSdpIfMatch(FileDescriptor fdObj,
                                           Action action,
                                           InetAddress address,
                                           int port)
    throws IOException
{
    boolean matched = false;
    for (Rule rule: rules) {
        if (rule.match(action, address, port)) {
            SdpSupport.convertSocket(fdObj);
            matched = true;
            break;
        }
    }
    if (log != null) {
        String addr = (address instanceof Inet4Address) ?
            address.getHostAddress() : "[" + address.getHostAddress() + "]";
        if (matched) {
            log.format("%s to %s:%d (socket converted to SDP protocol)\n", action, addr, port);
        } else {
            log.format("%s to %s:%d (no match)\n", action, addr, port);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:SdpProvider.java

示例2: create

import sun.net.sdp.SdpSupport; //导入依赖的package包/类
@Override
protected void create(boolean stream) throws IOException {
    if (!stream)
        throw new UnsupportedOperationException("Must be a stream socket");
    fd = SdpSupport.createSocket();
    if (socket != null)
        socket.setCreated();
    if (serverSocket != null)
        serverSocket.setCreated();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:SdpSocketImpl.java

示例3: openServerSocketChannel

import sun.net.sdp.SdpSupport; //导入依赖的package包/类
/**
 * Opens a socket channel to a SDP socket.
 *
 * <p> The channel will be associated with the system-wide default
 * {@link java.nio.channels.spi.SelectorProvider SelectorProvider}.
 *
 * @return  a new ServerSocketChannel
 *
 * @throws  UnsupportedOperationException
 *          If SDP is not supported or not supported by the default selector
 *          provider
 * @throws  IOException
 *          If an I/O error occurs
 */
public static ServerSocketChannel openServerSocketChannel()
    throws IOException
{
    FileDescriptor fd = SdpSupport.createSocket();
    return sun.nio.ch.Secrets.newServerSocketChannel(fd);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:Sdp.java

示例4: openSocketChannel

import sun.net.sdp.SdpSupport; //导入依赖的package包/类
/**
 * Opens a socket channel to a SDP socket.
 *
 * <p> The channel will be associated with the system-wide default
 * {@link java.nio.channels.spi.SelectorProvider SelectorProvider}.
 *
 * @return  a new SocketChannel
 *
 * @throws  UnsupportedOperationException
 *          If SDP is not supported or not supported by the default selector
 *          provider
 * @throws  IOException
 *          If an I/O error occurs.
 */
public static SocketChannel openSocketChannel() throws IOException {
    FileDescriptor fd = SdpSupport.createSocket();
    return sun.nio.ch.Secrets.newSocketChannel(fd);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:Sdp.java


注:本文中的sun.net.sdp.SdpSupport类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。