Add function to close unixgram connection

This commit is contained in:
Matias Doyle 2017-09-19 15:38:36 +02:00
parent 03f5226fe0
commit 0402bbb5de
No known key found for this signature in database
GPG Key ID: D8D001818E21F4D1
2 changed files with 7 additions and 0 deletions

View File

@ -199,6 +199,10 @@ func (err *ParseError) Error() string {
return b.String()
}
func (uc *unixgramConn) Close() error {
return uc.c.Close()
}
func (uc *unixgramConn) Ping() error {
resp, err := uc.cmd("PING")
if err != nil {

View File

@ -143,6 +143,9 @@ func (r *configuredNetwork) Flags() []string { return r.flags }
// Conn is a connection to wpa_supplicant over one of its communication
// channels.
type Conn interface {
// Close closes the unixgram connection
Close() error
// Ping tests the connection. It returns nil if wpa_supplicant is
// responding.
Ping() error