Exemple #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
}
Exemple #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
}
Exemple #3
0
// Close the channel
func (c *Channel) Close() error {
	if status := bridge.MessageClose(bridge.MessageChannel(c.privChan)); status {
		return nil
	}
	return ErrChannelClose
}