Examples of shutdownOutput()


Examples of java.net.Socket.shutdownOutput()

     
//      Log.report( "t.reading" );
      assertEquals( -1, t.getInputStream().read() );
//      Log.report( "t.eof" );
     
      t.shutdownOutput();
      t.close();
      t = null;
     
      assertWhat( What.DOWN, dh.what );
//      Log.report( "down" );
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

   
    assertWhat( What.UP, dh.what );
    assertNull( dh.xsender );
    assertNull( dh.xbuf );
   
    t.shutdownOutput();
   
    assertWhat( What.DOWN, dh.what );
    assertNull( dh.xsender );
    assertNull( dh.xbuf );
   
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

                {
                    // TODO - is this really required?
                    Socket socket= ((SocketChannel)_channel).socket();
                    try
                    {
                        socket.shutdownOutput();
                    }
                    finally
                    {
                        socket.close();
                    }
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

        Socket worker = server.accept();
        OutputStream theOutput = worker.getOutputStream();

        // shutdown the output
        worker.shutdownOutput();

        // send the regular data
        String sendString = new String("Test");
        try {
            theOutput.write(sendString.getBytes());
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

        client.close();
        server.close();

        // Regression test for HARMONY-2944
        Socket s = new Socket("0.0.0.0", 0, false);
        s.shutdownOutput();
        try {
            s.shutdownOutput();
            fail("should throw SocketException");
        } catch (SocketException se) {
            // Expected
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

        // Regression test for HARMONY-2944
        Socket s = new Socket("0.0.0.0", 0, false);
        s.shutdownOutput();
        try {
            s.shutdownOutput();
            fail("should throw SocketException");
        } catch (SocketException se) {
            // Expected
        }
        s.close();
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

        // Regression test for HARMONY-873
        ServerSocket ss2 = new ServerSocket(0);
        Socket s = new Socket("127.0.0.1", ss2.getLocalPort());
        ss2.accept();
        s.shutdownOutput();
        try {
            s.getOutputStream();
            fail("should throw SocketException");
        } catch (SocketException e) {
            // expected
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

        // make sure we get the right answer with newly connected socket
        assertFalse("Socket indicated output shutdown when it should not have",
                worker.isOutputShutdown());

        // shutdown the output
        worker.shutdownOutput();

        // make sure we get the right answer once it is shut down
        assertTrue(
                "Socket indicated output was NOT shutdown when it should have been",
                worker.isOutputShutdown());
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

        theOutput.flush();

        // Send the urgent data byte which should not be received
        worker.sendUrgentData("UrgentData".getBytes()[0]);
        theOutput.write(sendBytes);
        worker.shutdownOutput();
        worker.close();

        // Try to read the bytes back
        int totalBytesRead = 0;
        byte[] myBytes = new byte[100];
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

        byte urgentByte = "UrgentData".getBytes()[0];
        worker.sendUrgentData(urgentByte);

        // Send more data, the urgent byte must stay in position
        theOutput.write(sendBytes);
        worker.shutdownOutput();
        worker.close();

        // Try to read the bytes back
        totalBytesRead = 0;
        myBytes = new byte[100];
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.