Exemplo n.º 1
0
// Send a request
func (c *Channel) Send(request []byte) error {
	if status := bridge.MessageSend(bridge.MessageChannel(c.privChan), request); status {
		return nil
	}
	return ErrRpciSend
}
Exemplo n.º 2
0
// Receive a response
func (c *Channel) Receive() ([]byte, error) {
	if res, status := bridge.MessageReceive(bridge.MessageChannel(c.privChan)); status {
		return res, nil
	}
	return nil, ErrRpciReceive
}
Exemplo n.º 3
0
// Close the channel
func (c *Channel) Close() error {
	if status := bridge.MessageClose(bridge.MessageChannel(c.privChan)); status {
		return nil
	}
	return ErrChannelClose
}