Skip to content

Commit

Permalink
readloop error
Browse files Browse the repository at this point in the history
  • Loading branch information
TenderIronHanhan committed Nov 10, 2022
1 parent d5c098c commit 8311341
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion core/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// ./openp2p install -node hhd1207-222 -token YOUR-TOKEN -sharebandwidth 0 -peernode hhdhome-n1 -dstip 127.0.0.1 -dstport 50022 -protocol tcp -srcport 22
func install() {
gLog.Println(LvINFO, "openp2p start. version: ", OpenP2PVersion)
gLog.Println(LvINFO, "Contact: QQ: 16947733, Email: [email protected]")
gLog.Println(LvINFO, "Contact: QQ group 16947733, Email [email protected]")
gLog.Println(LvINFO, "install start")
defer gLog.Println(LvINFO, "install end")
// auto uninstall
Expand Down Expand Up @@ -74,6 +74,7 @@ func install() {
} else {
gLog.Println(LvINFO, "start openp2p service ok.")
}
gLog.Println(LvINFO, "Visit WebUI on https://console.openp2p.cn")
}

func installByFilename() {
Expand Down
5 changes: 2 additions & 3 deletions core/p2pnetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,11 @@ func P2PNetworkInstance(config *NetworkConfig) *P2PNetwork {
}

func (pn *P2PNetwork) run() {
go pn.readLoop()
go pn.autorunApp()
heartbeatTimer := time.NewTicker(NetworkHeartbeatTime)
for pn.running {
select {
case <-heartbeatTimer.C: // TODO: deal with connect failed, no send hb
case <-heartbeatTimer.C:
pn.write(MsgHeartbeat, 0, "")

case <-pn.restartCh:
Expand Down Expand Up @@ -488,7 +487,7 @@ func (pn *P2PNetwork) init() error {
err = errors.New("get local ip failed")
break
}

go pn.readLoop()
pn.config.mac = getmac(pn.config.localIP)
pn.config.os = getOsName()

Expand Down
2 changes: 1 addition & 1 deletion core/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"
)

const OpenP2PVersion = "3.5.0"
const OpenP2PVersion = "3.5.2"
const ProducnName string = "openp2p"
const LeastSupportVersion = "3.0.0"

Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ require (
github.com/nxadm/tail v1.4.8 // indirect
github.com/onsi/ginkgo v1.16.4 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/mobile v0.0.0-20221020085226-b36e6246172e // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/tools v0.1.12 // indirect
Expand Down

0 comments on commit 8311341

Please sign in to comment.