Package java.net

Examples of java.net.Socket.shutdownInput()


    try {
      if (!socket.isClosed() && !socket.isOutputShutdown()) {
        socket.shutdownOutput();
      }
      if (!socket.isClosed() && !socket.isInputShutdown()) {
        socket.shutdownInput();
      }
    } catch (Exception e) {
    }
    try {
      socket.close();
View Full Code Here


        }

        Socket socket = ((SocketChannel)key.channel()).socket();
        try{
            if (!socket.isInputShutdown()){
                socket.shutdownInput();
            }
        } catch (IOException ex){
            ;
        }
       
View Full Code Here

    try {
      if (!socket.isClosed() && !socket.isOutputShutdown()) {
        socket.shutdownOutput();
      }
      if (!socket.isClosed() && !socket.isInputShutdown()) {
        socket.shutdownInput();
      }
    } catch (Exception e) {
    }
    try {
      socket.close();
View Full Code Here

    {
        final Socket socket = channel.socket();
        try {
            if (how == ShutdownType.READ  || how == ShutdownType.BOTH) {
                if (!socket.isInputShutdown()) {
                    socket.shutdownInput();
                    key.selected(OP_READ);
                }
            }
            if (how == ShutdownType.WRITE || how == ShutdownType.BOTH) {
                if (!socket.isOutputShutdown()) {
View Full Code Here

        // but can still write in opposite direction.
        server.getOutputStream().write(1);
        assertEquals(1, client.getInputStream().read());

        // server can shutdown input to match the shutdown out of client
        server.shutdownInput();

        // now we EOF instead of reading -1
        try
        {
            server.getInputStream().read();
View Full Code Here

            assertFalse(server.isInputShutdown());
            //System.err.println("ISHUT "+server);

            try
            {
                server.shutdownInput();
            }
            catch (SocketException e)
            {
                // System.err.println(e);
            }
View Full Code Here

            // Server generator shutdowns output after non persistent sending response.
            server.shutdownOutput();

            // client endpoint reads EOF and shutdown input as result
            assertEquals(-1, client.getInputStream().read());
            client.shutdownInput();

            // client connection see's EOF and shutsdown output as no more requests to be sent.
            client.shutdownOutput();

            // Since input already shutdown, client also closes socket.
View Full Code Here

                // Close the various streams and the socket itself.
                try {
        objectOut.flush();
        socket.shutdownOutput();
        socket.shutdownInput();
                    objectOut.close();
                    objectIn.close();
                    out.close();
                    in.close();
                    socket.close();
View Full Code Here

      // Close the various streams and the socket.
            try {
    objectOut.flush();
    socket.shutdownOutput();
    socket.shutdownInput();
                objectOut.close();
                out.close();
                objectIn.close();
                in.close();
                socket.close();
View Full Code Here

                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
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.