Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4511783

DatagramSocket.getTrafficClass() throwing SocketException on Sol 8 and SolIA8

XMLWordPrintable

    • rc1
    • sparc
    • solaris_8
    • Verified

      DatagramSocket.getTrafficClass() throwing following SocketException on Sol sparc 8 and Sol IA8 with merlin build 82. Its working fine with build 81. Even with build 82 it works fine on Win 98 and Sol 2.6 .

      java.net.SocketException: error getting socket option: Option not supported by protocol

              at java.net.PlainDatagramSocketImpl.socketGetOption(Native Method)
              at java.net.PlainDatagramSocketImpl.getOption(PlainDatagramSocketImpl.java:279)
              at java.net.DatagramSocket.getTrafficClass(DatagramSocket.java:1021)
              at UdpServer.main(UdpServer.java:15)



      You can execute below snippet to get this..

      public class UdpServer {

              public static void main(String[] args) {
              int port = 2350;

              try{
                      //SocketAddress sa = new InetSocketAddress(port);
                      //DatagramSocket ds = new DatagramSocket(sa);
                      DatagramSocket ds = new DatagramSocket();

                      //ds.setTrafficClass(1);
                      System.out.println("get traffic class " + ds.getTrafficClass());
              }catch(Exception exp) {
                      exp.printStackTrace();
              }

              }

      }

            alanb Alan Bateman
            vakellasunw Venkata Akella (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: