本文整理汇总了Java中java.net.ServerSocket.setPerformancePreferences方法的典型用法代码示例。如果您正苦于以下问题:Java ServerSocket.setPerformancePreferences方法的具体用法?Java ServerSocket.setPerformancePreferences怎么用?Java ServerSocket.setPerformancePreferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.net.ServerSocket
的用法示例。
在下文中一共展示了ServerSocket.setPerformancePreferences方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setProperties
import java.net.ServerSocket; //导入方法依赖的package包/类
public void setProperties(ServerSocket socket) throws SocketException{
if (rxBufSize != null)
socket.setReceiveBufferSize(rxBufSize.intValue());
if (performanceConnectionTime != null && performanceLatency != null &&
performanceBandwidth != null)
socket.setPerformancePreferences(
performanceConnectionTime.intValue(),
performanceLatency.intValue(),
performanceBandwidth.intValue());
if (soReuseAddress != null)
socket.setReuseAddress(soReuseAddress.booleanValue());
if (soTimeout != null && soTimeout.intValue() >= 0)
socket.setSoTimeout(soTimeout.intValue());
}
示例2: setProperties
import java.net.ServerSocket; //导入方法依赖的package包/类
public void setProperties(ServerSocket socket) throws SocketException {
if (rxBufSize != null)
socket.setReceiveBufferSize(rxBufSize.intValue());
if (performanceConnectionTime != null && performanceLatency != null && performanceBandwidth != null)
socket.setPerformancePreferences(performanceConnectionTime.intValue(), performanceLatency.intValue(),
performanceBandwidth.intValue());
if (soReuseAddress != null)
socket.setReuseAddress(soReuseAddress.booleanValue());
if (soTimeout != null && soTimeout.intValue() >= 0)
socket.setSoTimeout(soTimeout.intValue());
}