MCPcopy Create free account
hub / github.com/AlexandreRouma/SDRPlusPlus / write

Method write

core/src/utils/networking.cpp:88–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86 }
87
88 bool ConnClass::write(int count, uint8_t* buf) {
89 if (!connectionOpen) { return false; }
90 std::lock_guard lck(writeMtx);
91 int ret;
92
93 if (_udp) {
94 int fromLen = sizeof(remoteAddr);
95 ret = sendto(_sock, (char*)buf, count, 0, (struct sockaddr*)&remoteAddr, sizeof(remoteAddr));
96 }
97 else {
98 ret = send(_sock, (char*)buf, count, 0);
99 }
100
101 if (ret <= 0) {
102 {
103 std::lock_guard lck(connectionOpenMtx);
104 connectionOpen = false;
105 }
106 connectionOpenCnd.notify_all();
107 }
108 return (ret > 0);
109 }
110
111 void ConnClass::readAsync(int count, uint8_t* buf, void (*handler)(int count, uint8_t* buf, void* ctx), void* ctx) {
112 if (!connectionOpen) { return; }

Callers 10

sendCommandMethod · 0.45
WavWriterMethod · 0.45
writeSamplesMethod · 0.45
closeMethod · 0.45
commandHandlerMethod · 0.45
monoHandlerMethod · 0.45
stereoHandlerMethod · 0.45
sinkHandlerMethod · 0.45
sinkHandlerMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected