本文整理汇总了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;未经允许,请勿转载。 |
请发表评论