// SendRequest ensures there is a connection, sends a request and waits for a response
SendRequest ensures there is a connection, sends a request and waits for a response
// SendRequest ensures there is a connection sends a request and waits for a response
func (sl *SignerListenerEndpoint) SendRequest(request SignerMessage) (SignerMessage, error) {
	sl.instanceMtx.Lock()
	defer sl.instanceMtx.Unlock()
	err := sl.ensureConnection(sl.timeoutAccept)
	if err != nil {
		return nil, err
	}
	err = sl.WriteMessage(request)
	if err != nil {
		return nil, err
	}
	res, err := sl.ReadMessage()
	if err != nil {
		return nil, err
	}
	return res, nil
}
func ( sl * SignerListenerEndpoint ) SendRequest ( request SignerMessage ) ( SignerMessage , error ) { sl . instanceMtx . Lock ( ) defer sl . instanceMtx . Unlock ( ) err := sl . ensureConnection ( sl . timeoutAccept ) if err != nil { return nil , err } err = sl . WriteMessage ( request ) if err != nil { return nil , err } res , err := sl . ReadMessage ( ) if err != nil { return nil , err } return res , nil }
SendRequest ensures there is a connection, sends a request and waits for a response
SendRequest ensures there is a connection sends a request and waits for a response