MCPcopy Create free account
hub / github.com/Tencent/phxpaxos / InitNetWork

Method InitNetWork

src/node/pnode.cpp:104–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104int PNode :: InitNetWork(const Options & oOptions, NetWork *& poNetWork)
105{
106 if (oOptions.poNetWork != nullptr)
107 {
108 poNetWork = oOptions.poNetWork;
109 PLImp("OK, use user network");
110 return 0;
111 }
112
113 int ret = m_oDefaultNetWork.Init(
114 oOptions.oMyNode.GetIP(), oOptions.oMyNode.GetPort(), oOptions.iIOThreadCount);
115 if (ret != 0)
116 {
117 PLErr("init default network fail, listenip %s listenport %d ret %d",
118 oOptions.oMyNode.GetIP().c_str(), oOptions.oMyNode.GetPort(), ret);
119 return ret;
120 }
121
122 poNetWork = &m_oDefaultNetWork;
123
124 PLImp("OK, use default network");
125
126 return 0;
127}
128
129int PNode :: CheckOptions(const Options & oOptions)
130{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected