1
0

fix: error time clear clipboard

This commit is contained in:
502647092 2018-08-30 22:16:18 +08:00
parent 94402c78a0
commit 0165ab48c0
2 changed files with 10 additions and 2 deletions

View File

@ -1,7 +1,15 @@
## clipboard-sync ## clipboard-sync
### CommandLineArgs
- `-t` Launch Type
- `s` Server
- `c` Client
- `-b` Bind Address (Server Only) Default `:8080`
- `-a` Server Address(Client Only) Default `http://127.0.0.1:8080`
### Server ### Server
./clipboard-sync -t s ./clipboard-sync -t s -b :8080
### Client ### Client
./clipboard-sync -a http://172.30.34.2:8080 ./clipboard-sync -a http://172.30.34.2:8080

View File

@ -69,7 +69,7 @@ func readClipboard(a string) {
sTime, _ := strconv.ParseInt(response.Header[timeHeader][0], 10, 64) sTime, _ := strconv.ParseInt(response.Header[timeHeader][0], 10, 64)
if sTime > updateTime && sText != old { if sTime > updateTime && sText != old {
old = sText old = sText
updateTime = time.Now().Unix() updateTime = sTime
clipboard.WriteAll(sText) clipboard.WriteAll(sText)
fmt.Printf("Update Clipboard: %s\n", sText) fmt.Printf("Update Clipboard: %s\n", sText)
} }