开发者

Writing a java.net.SocketImplFactory

开发者 https://www.devze.com 2022-12-17 04:12 出处:网络
The javadoc for SocketImplFactory specifically mentions that \"An application, by changing the socket factory that creates the socket implementation, can configure itself to create sockets appropriate

The javadoc for SocketImplFactory specifically mentions that "An application, by changing the socket factory that creates the socket implementation, can configure itself to create sockets appropriate to the local firewall."

However, in order to connect to the firewall in question, one would need a real socket to do the real connection. With the default SocketImplFactory replaced, how does one go about getting a real socket?

I know that java.net.PlainSocketImpl and java.net.SocksS开发者_运维百科ocketImpl are available on Sun's Java, but is there any way to do it in a way that is portable between JVMs?


There is some information about the thinking behind this documentation here


You create the socket to connect to the firewall before calling setSocketImplFactory.

0

精彩评论

暂无评论...
验证码 换一张
取 消