Examples of shutdownOutput()


Examples of java.net.Socket.shutdownOutput()

        worker.sendUrgentData(urgentByte1);
        worker.sendUrgentData(urgentByte2);

        // 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

Examples of java.net.Socket.shutdownOutput()

    InputStream theInput = theSocket.getInputStream();
    OutputStream theOutput = servSock.getOutputStream();

    // shutdown the output
    servSock.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()

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

    // shutdown the output
    servSock.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",
        servSock.isOutputShutdown());
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

    public void test_getOutputStream_shutdownOutput() throws Exception {
        // regression test for Harmony-873
        ServerSocket ss = new ServerSocket(0);
        Socket s = new Socket("127.0.0.1", ss.getLocalPort());
        ss.accept();
        s.shutdownOutput();
        try {
            s.getOutputStream();
            fail("should throw SocketException");
        } catch (SocketException e) {
            // expected
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

            s.shutdownInput();
            fail("should throw SocketException");
        } catch (SocketException se) {
            // expected
        }
        s.shutdownOutput();

        try {
            s.shutdownOutput();
            fail("should throw SocketException");
        } catch (SocketException se) {
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

            // expected
        }
        s.shutdownOutput();

        try {
            s.shutdownOutput();
            fail("should throw SocketException");
        } catch (SocketException se) {
            // expected
        }
    }
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

        Socket sock = this.socket;
        try {
            doFlush();
            try {
                try {
                    sock.shutdownOutput();
                } catch (IOException ignore) {
                }
                try {
                    sock.shutdownInput();
                } catch (IOException ignore) {
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

        Socket sock = this.socket;
        try {
            doFlush();
            try {
                try {
                    sock.shutdownOutput();
                } catch (IOException ignore) {
                }
                try {
                    sock.shutdownInput();
                } catch (IOException ignore) {
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

    {
        if (_channel.isOpen() && _channel instanceof SocketChannel)
        {
            Socket socket= ((SocketChannel)_channel).socket();
            if (!socket.isClosed()&&!socket.isOutputShutdown())
                socket.shutdownOutput();
        }
    }
   
    /* (non-Javadoc)
     * @see org.eclipse.io.EndPoint#close()
View Full Code Here

Examples of java.net.Socket.shutdownOutput()

        try {
            OutputStream outstream = sock.getOutputStream();
            outstream.write(cmd.getBytes());
            outstream.flush();
            // this replicates NC - close the output stream before reading
            sock.shutdownOutput();

            reader = new BufferedReader(new InputStreamReader(sock.getInputStream()));
            StringBuilder sb = new StringBuilder();
            String line;
            while ((line = reader.readLine()) != null) {
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.