Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] IE Datagram Sockets

Started by d73bmh Apr 14, 2001 at 10:12 AM 0 replies 300+ views
Original Post
d73bmh
d73bmh
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
tatarintsev
tatarintsev
You must use signed applet or change "Security" settings in MSIE.

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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.