Advertisement

[java] IE Datagram Sockets

Started by April 14, 2001 10:12 AM
0 comments, last by d73bmh 23 years, 10 months ago
Hi, The following code throws a security exception in IE but works in Netscape et al, it is test code for a multiplayer title I am trying to write. It should be fine as I am trying to listen for packets from the server that hosted the applet and TCP connections work. If I try to bind the socket to a host using the getCodeBase() method it fails as well. I have heard that there is an inherent bug in MSIE which doesn't correctly create datagram sockets (look here). I hope and pray that someone has managed to create and use UDP sockets in an applet without signing it or changing the security settings in IE - I *really* need to start the applet transparently. Cheers,


import java.awt.*;
import java.applet.*;
import java.io.*;
import java.net.*;

public class Annoyance extends Applet
{   
   public void init()
   {
      try
      {
         DatagramSocket iSocket = new DatagramSocket(60000);
         iSocket.close();
      }
      catch (Exception e)
      {
         System.out.println("Error: "+e.getMessage());
      }
   }
}
  
Edited by - d73bmh on April 14, 2001 11:29:50 AM
it's all a matter of perseverance
You must use signed applet or change "Security" settings in MSIE.

I had the same problem two weeks before.
Vitaly V. Tatarintsev

This topic is closed to new replies.

Advertisement