Commit 014c076f authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

dist: split NetListen out of NetConnect

This allows NetListen to be done before other intialization, so that
listening sockets for peers are created already. This makes
orchestration a lot easier. E.g. listener proxy will have listening
sockets for peers already created when still waiting for connector proxy
to connect.
parent 52c0cb9c
......@@ -99,7 +99,7 @@ bool NetPeerAdd(const char *path, bool dev) {
}
static int PeersInitNets() {
int NetListen() {
#ifdef DEBUG
fprintf(stderr, "Creating net listening sockets\n");
#endif
......@@ -132,7 +132,7 @@ static int PeersInitNets() {
return 0;
}
static int PeersInitDevs() {
int NetConnect() {
#ifdef DEBUG
fprintf(stderr, "Connecting to device sockets\n");
#endif
......
......@@ -96,6 +96,7 @@ extern struct Peer *peers;
int NetInit(const char *shm_path_, size_t shm_size_, int epfd_);
bool NetPeerAdd(const char *path, bool dev);
struct Peer *NetPeerLookup(uint32_t id);
int NetListen(void);
int NetConnect(void);
void NetPoll(void);
int NetPeerSendDevIntro(struct Peer *peer);
......
......@@ -176,6 +176,9 @@ int main(int argc, char *argv[]) {
if (NetInit(shm_path, shm_size, epfd))
return EXIT_FAILURE;
if (NetListen())
return EXIT_FAILURE;
if (mode_listen) {
if (RdmaListen(&addr))
return EXIT_FAILURE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment