view src/main/java/alice/daemon/OutboundTcpConnection.java @ 527:bfec2c3ff1b8 dispose

change unzip
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Thu, 30 Apr 2015 18:14:02 +0900
parents aefbe41fcf12
children bd245df5cba3 646f705e65b1
line wrap: on
line source

package alice.daemon;

import alice.datasegment.Command;

public class OutboundTcpConnection extends Thread {

    public Connection connection;

    public OutboundTcpConnection(Connection connection) {
        this.connection = connection;
    }

    /**
     * pipeline thread for transmission
     */
    public void run() {
        while (true) {
            try {
                Command cmd = connection.sendQueue.take();
                switch (cmd.type) {
                case CLOSE:
                    connection.close();
                    return;
                case FINISH:
                    System.exit(0);
                    return;
                default:
                    break;
                }
                connection.write(cmd);//ここでconvert()がよばれてる
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

}