Re: [問題]請問applet 開socket 連Java 寫的server程式
※ 引述《welon.bbs@ptt.cc (小龍)》之銘言:
> 如題 我開一個IE內崁Applet的程式
> Applet是Client端開socket 連Server端的程式
> 可是Clinet端好像開不出Socket 應該是權限的問題
> throw出以下的情況...
> access denied (java.net.SocketPermission 140.xxx.xxx.xxx:9999 connect,resolve)
> 這樣的情況
> 煩請大家回答...
http://java.sun.com/sfaq/#socket
8. How can an applet open a network connection to a computer on the internet?
Applets are not allowed to open network connections to any computer, except
for the host that provided the .class files. This is either the host where
the html page came from, or the host specified in the codebase parameter in
the applet tag, with codebase taking precendence.
For example, if you try to do this from an applet that did not originate from
the machine foo.com, it will fail with a security exception:
Socket s = new Socket("foo.com", 25, true);
--
◤ ▁▁──────────────────────╮
淡江資工地上站 ▁▁ Author: flame ●│
◣ bbs.cs.tku.edu.tw From: 210-58-48-57.cm.dynamic.apol.com.tw│
討論串 (同標題文章)