MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / ConnectTo

Method ConnectTo

Kernel/src/net/socket.cpp:135–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135int LocalSocket::ConnectTo(Socket* client){
136 assert(passive);
137
138 pendingConnections.Wait();
139
140 pending.add_back(client);
141
142 acquireLock(&watcherLock);
143 while(watching.get_length()){
144 watching.remove_at(0)->Signal();
145 }
146 releaseLock(&watcherLock);
147
148 while(!client->connected){
149 // TODO: Actually block the task
150 Scheduler::Yield();
151 }
152
153 pendingConnections.Signal();
154
155 return 0;
156}
157
158void LocalSocket::DisconnectPeer(){
159 assert(peer);

Callers 1

ConnectMethod · 0.80

Calls 6

SignalMethod · 0.80
YieldFunction · 0.50
WaitMethod · 0.45
add_backMethod · 0.45
get_lengthMethod · 0.45
remove_atMethod · 0.45

Tested by

no test coverage detected