()
| 97 | } |
| 98 | |
| 99 | func (conn *WslConn) DeriveConnStatus() wshrpc.ConnStatus { |
| 100 | conn.Lock.Lock() |
| 101 | defer conn.Lock.Unlock() |
| 102 | return wshrpc.ConnStatus{ |
| 103 | Status: conn.Status, |
| 104 | Connected: conn.Status == Status_Connected, |
| 105 | WshEnabled: conn.WshEnabled.Load(), |
| 106 | Connection: conn.GetName(), |
| 107 | HasConnected: (conn.LastConnectTime > 0), |
| 108 | ActiveConnNum: conn.ActiveConnNum, |
| 109 | Error: conn.Error, |
| 110 | WshError: conn.WshError, |
| 111 | NoWshReason: conn.NoWshReason, |
| 112 | WshVersion: conn.WshVersion, |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | func (conn *WslConn) Infof(ctx context.Context, format string, args ...any) { |
| 117 | log.Print(fmt.Sprintf("[conn:%s] ", conn.GetName()) + fmt.Sprintf(format, args...)) |
no test coverage detected