Code example for Socket

Methods: close, shutdownInput, shutdownOutput

0
        Socket sock = this.socket;
        try { 
            doFlush(); 
            try { 
                try { 
                    sock.shutdownOutput();
                } catch (IOException ignore) {
                } 
                try { 
                    sock.shutdownInput();
                } catch (IOException ignore) {
                } 
            } catch (UnsupportedOperationException ignore) {
                // if one isn't supported, the other one isn't either 
            } 
        } finally { 
            sock.close();
        } 
    } 
 
}