All About Class SocketImpl in Java

0
25
Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

SocketImpl in Java
SocketImpl in Java

SocketImpl in Java:

The abstract class SocketImpl is a common super class of classes that actually implements sockets.It is used to create both client socket and server sockets.A plain socket implements these methods exactly as described without attempting to go through a firewall or proxy.
SocketImpl provides environment specific implementation for Socket and ServerSocket.

The structure of the class SocketImpl is given as:


public abstract class java.net.SocketImpl extends java.lang.Object{
//constructor
public SocketImpl();
//the default constructor for a socket implementation.
//member elements
protected InetAddress address;// the IP address of the remote end of the socket.
protected FileDescriptor descriptor;//the file descriptor object for this socket.
protected int localPort;// the local port to which this socket is connected.
protected int port;// the port number on which the remote machine (hos)to which this socket is connected.
//method
protected abstract void accept(SocketImpl sock)throws IOException;
protected abstract int available()throws IOException;
protected abstract void bind(InetAddress host,int port)throws IOException;
protected abstract void close()throws IOException;
protected abstract void conect(InetAddress address,int port)throws IOException;
protected abstract void conect(String host,int port)throws IOException;
protected abstract void create(boolean stream)throws IOException;
protected FileDescriptor getFileDescriptor();
protected InetAddress getInetAddress();
protected int getLocalPort();
protected int getPort();
protected abstract InputStream getInputStream()throws IOException;
protected abstract OutputStream getOutputStream()throws IOException;
protected abstract void listen(int count)throws IOException;
public String toString();//Overrides Object
}
 
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

LEAVE A REPLY

Please enter your comment!
Please enter your name here