![]() |
VOOZH | about |
In Java, SocketImplFactory Class is an interface java.net.SocketImplFactory Class is defining a factory for SocketImpl instances, as this interface is usable by sockets classes to create the sockets execution that implements various policies through it. Interface java.net.SocketImplFactory Class is defining the factory for setting the socketing executions. It uses classes as Socket and ServerSocket to create to its current socket executions on it.
--> java.net Package --> SocketImplFactory Class
java.net is one of package that use SocketImplFactory in providing the classes for executing on its networking applications.
| Method | Action Performed |
|---|---|
| createSocketImpl() | Creating an new SocketImpl instances on it |
Uses of SocketImplFactory Class in java.net package
| Method | Action Performed |
|---|---|
| ServerSocket.setSocketFactory(SocketImplFactory fac) | Setting up an server socketing execution on factories of the application. Using an ServerSocketFactory and its subclass to ServerSocket directly. |
| Socket.setSocketImplFactory(SocketImplFactory fac) | Setting up an client socketing executions factories of its application. Using an SocketFactory and its subclass to Socket directly. |
Example 1:
Output:
Example 2:
Output:
Note: In above two code we are only emphasizing on eccentric concept so do not look for the start point of execution of code as main() method is not inserted over here.