2015-12-01 20:12:01 -08:00
|
|
|
package proxy
|
|
|
|
|
|
|
|
import (
|
2016-01-25 14:34:08 -08:00
|
|
|
tmspcli "github.com/tendermint/tmsp/client"
|
2015-12-01 20:12:01 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
// This is goroutine-safe, but users should beware that
|
|
|
|
// the application in general is not meant to be interfaced
|
|
|
|
// with concurrent callers.
|
2016-01-06 17:14:20 -08:00
|
|
|
type remoteAppConn struct {
|
2016-02-21 23:56:46 -08:00
|
|
|
*tmspcli.Client
|
2015-12-01 20:12:01 -08:00
|
|
|
}
|
|
|
|
|
2016-02-08 00:48:58 -08:00
|
|
|
func NewRemoteAppConn(addr string) (*remoteAppConn, error) {
|
2016-02-21 23:56:46 -08:00
|
|
|
client, err := tmspcli.NewClient(addr)
|
2016-02-08 00:48:58 -08:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
appConn := &remoteAppConn{
|
2016-02-21 23:56:46 -08:00
|
|
|
Client: client,
|
2015-12-01 20:12:01 -08:00
|
|
|
}
|
2016-02-08 00:48:58 -08:00
|
|
|
return appConn, nil
|
2015-12-01 20:12:01 -08:00
|
|
|
}
|