Socket setPerformancePreferences Example
Socket class setPerformancePreferences example. This example shows you how to use setPerformancePreferences method.
Socket class setPerformancePreferences example. ublic void setPerformancePreferences(int connectionTime, int latency, int bandwidth) Sets performance preferences for this socket. Sockets use the TCP/IP protocol by default. Some implementations may offer alternative protocols which have different performance characteristics than TCP/IP.
Here is the code
/*
* @ # SetPerformancePreferences.java
* A class repersenting use to SetPerformancePreferences method
* of NumberFormat class in java.net package
* version 17 June 2008
* author Rose India
*/
import java.net.*;
public class SetPerformancePreferences {
public static void main(String args[]) throws Exception {
Socket socket = new Socket();
//Connects this socket to the server.
socket.connect(new InetSocketAddress("192.168.10.222", 8080));
System.out.println("Sets performance preferences for this socket. ");
socket.setPerformancePreferences(10, 11, 11);
socket.close();
}
} |
Output
| Sets performance preferences for this socket. |
|