@Override
    public void open(String name) throws ChannelException {
        try {
            Socket socket = new Socket(host, port);
            out = new PrintWriter(socket.getOutputStream(), true);
            in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            receiver = new Receiver();
            Thread receiverThread = new Thread(receiver);
            receiverThread.start();
        }
        catch (IOException ex) {
            throw new ChannelException(ex);
        }
    }