rtl8720dn: add handling when connect fails

This commit is contained in:
sago35
2022-12-25 11:30:49 +09:00
parent e3e95cacfe
commit 86cc0e31f1
+4 -1
View File
@@ -71,10 +71,13 @@ func (d *Driver) ConnectTCPSocket(addr, port string) error {
name[6] = byte(ipaddr[2])
name[7] = byte(ipaddr[3])
_, err = d.Rpc_lwip_connect(socket, name, uint32(len(name)))
result, err := d.Rpc_lwip_connect(socket, name, uint32(len(name)))
if err != nil {
return err
}
if result == -1 {
return fmt.Errorf("failed to connect to %d.%d.%d.%d port %s", addr[0], addr[1], addr[2], addr[3], port)
}
readset := []byte{}
writeset := []byte{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}