package anastore.net;

import anastore.util.*;
import java.io.IOException;

/**
 * Send half of a channel. Accepts messages and sends them across the
 * network to the other end of the channel.
 */
public interface SendChannel {
    /**
     * Send a synchronous message.
     *
     * @return a ReceiveChannel for reading replies to the message.
     * @throws IOException
     */
    public ReceiveChannel send(SyncMessage msg) throws IOException;

    /**
     * Send an asynchronous message. As the message does not expect a
     * reply, no channel is returned.
     *
     * @throws IOException
     */
    public void send(AsyncMessage msg) throws IOException;
}
