• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DatagramSocketImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: DatagramSocketAdapter

import java.net.DatagramSocketImpl; //导入依赖的package包/类
DatagramSocketAdapter(DatagramSocketImpl socketimpl, DatagramChannelImpl channelImpl) {
    super(socketimpl);
    this.channelImpl = channelImpl;

    // Sync state socket state with the channel it is being created from
    if (channelImpl.isBound) {
        onBind(channelImpl.localAddress, channelImpl.localPort);
    }
    if (channelImpl.connected) {
        onConnect(
                channelImpl.connectAddress.getAddress(),
                channelImpl.connectAddress.getPort());
    } else {
        onDisconnect();
    }
    if (!channelImpl.isOpen()) {
        onClose();
    }
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:20,代码来源:DatagramChannelImpl.java


示例2: testSetDatagramSocketImpl

import java.net.DatagramSocketImpl; //导入依赖的package包/类
private void testSetDatagramSocketImpl(HttpServletResponse response)
    throws IOException, AssertionFailedException {
  DatagramSocketImplFactory mockFactory =
      new DatagramSocketImplFactory() {
        @Override
        public DatagramSocketImpl createDatagramSocketImpl() {
          return null;
        }
      };

  SocketException caught = null;
  try {
    DatagramSocket.setDatagramSocketImplFactory(mockFactory);
  } catch (SocketException e) {
    caught = e;
  }
  assertNotNull("caught", caught, response);
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-java-vm-runtime,代码行数:19,代码来源:TestDatagramSocketServlet.java


示例3: boot

import java.net.DatagramSocketImpl; //导入依赖的package包/类
/**
 * Set up socket factories to use JikesRVMSocketImpl
 */
public static void boot() {
  try {
    Socket.setSocketImplFactory(new SocketImplFactory() {
      public SocketImpl createSocketImpl() { return new JikesRVMSocketImpl(); }
    });
    ServerSocket.setSocketFactory(new SocketImplFactory() {
      public SocketImpl createSocketImpl() { return new JikesRVMSocketImpl(); }
    });
    DatagramSocket.setDatagramSocketImplFactory(new DatagramSocketImplFactory() {
      public DatagramSocketImpl createDatagramSocketImpl() {
        throw new VM_UnimplementedError("Need to implement JikesRVMDatagramSocketImpl");
      }
    });
  } catch (java.io.IOException e) {
    VM.sysFail("trouble setting socket impl factories");
  }
}
 
开发者ID:rmcilroy,项目名称:HeraJVM,代码行数:21,代码来源:JikesRVMSocketImpl.java


示例4: QoSDatagramSocket

import java.net.DatagramSocketImpl; //导入依赖的package包/类
public QoSDatagramSocket(SocketAddress bindSocketAddress) throws SocketException {
    super(bindSocketAddress);
    try {
        Field implField = DatagramSocket.class.getDeclaredField("impl");
        implField.setAccessible(true);

        this.impl = (DatagramSocketImpl) implField.get(this);
    } catch (Exception ex) {
        throw new RuntimeException(ex);
    }
}
 
开发者ID:ARMmbed,项目名称:java-coap,代码行数:12,代码来源:QoSDatagramSocket.java


示例5: test_ConstructorLjava_net_DatagramSocketImpl

import java.net.DatagramSocketImpl; //导入依赖的package包/类
public void test_ConstructorLjava_net_DatagramSocketImpl() {
    class testDatagramSocket extends DatagramSocket {
        public testDatagramSocket(DatagramSocketImpl impl){
           super(impl);
        }
    }

    try {
        new testDatagramSocket((DatagramSocketImpl) null);
        fail("exception expected");
    } catch (NullPointerException ex) {
        //expected
    }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:15,代码来源:OldDatagramSocketTest.java


示例6: test_ConstructorLjava_net_DatagramSocketImpl

import java.net.DatagramSocketImpl; //导入依赖的package包/类
/**
 * @tests java.net.DatagramSocket#DatagramSocket(java.net.DatagramSocketImpl)
 */
public void test_ConstructorLjava_net_DatagramSocketImpl() {
    class SimpleTestDatagramSocket extends DatagramSocket {
        public SimpleTestDatagramSocket(DatagramSocketImpl impl) {
            super(impl);
        }
    }

    try {
        new SimpleTestDatagramSocket((DatagramSocketImpl) null);
        fail("exception expected");
    } catch (NullPointerException ex) {
        // expected
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:DatagramSocketTest.java


示例7: test_ConstructorLjava_net_DatagramSocketImpl

import java.net.DatagramSocketImpl; //导入依赖的package包/类
/**
 * @tests java.net.DatagramSocket#DatagramSocket(java.net.DatagramSocketImpl)
 */
public void test_ConstructorLjava_net_DatagramSocketImpl() {
	class testDatagramSocket extends DatagramSocket {
	    public testDatagramSocket(DatagramSocketImpl impl){
	       super(impl);
	    }
	}

	try {
		new testDatagramSocket((DatagramSocketImpl) null);
		fail("exception expected");
	} catch (NullPointerException ex) {
		//expected
	}
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:18,代码来源:DatagramSocketTest.java


示例8: DatagramSocketAdapter

import java.net.DatagramSocketImpl; //导入依赖的package包/类
DatagramSocketAdapter(DatagramSocketImpl socketimpl,
        DatagramChannelImpl channelImpl) {
    super(socketimpl);
    this.channelImpl = channelImpl;
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:6,代码来源:DatagramChannelImpl.java


示例9: createDatagramSocketImpl

import java.net.DatagramSocketImpl; //导入依赖的package包/类
public DatagramSocketImpl createDatagramSocketImpl() {
    return new TestDatagramSocketImpl();
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:4,代码来源:OldDatagramSocketTest.java


示例10: createDatagramSocketImpl

import java.net.DatagramSocketImpl; //导入依赖的package包/类
public DatagramSocketImpl createDatagramSocketImpl() {
    isCreateDatagramSocketImpl = true;
    return new TestDatagramSocketImpl();
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:5,代码来源:OldDatagramSocketImplFactoryTest.java


示例11: createDatagramSocketImpl

import java.net.DatagramSocketImpl; //导入依赖的package包/类
public DatagramSocketImpl createDatagramSocketImpl() {
    return new PlainDatagramSocketImpl();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:4,代码来源:DatagramSocketTest.java


示例12: getDatagramSocketImpl

import java.net.DatagramSocketImpl; //导入依赖的package包/类
public static DatagramSocketImpl getDatagramSocketImpl() {
    return new PlainDatagramSocketImpl();
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:4,代码来源:SocketImplProvider.java


示例13: getMulticastSocketImpl

import java.net.DatagramSocketImpl; //导入依赖的package包/类
public static DatagramSocketImpl getMulticastSocketImpl() {
    return new PlainMulticastSocketImpl();
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:4,代码来源:SocketImplProvider.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Patch类代码示例发布时间:2022-05-21
下一篇:
Java BackgroundPosition类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap