MCPcopy Create free account
hub / github.com/SmingHub/Sming / connect

Method connect

Sming/Components/Network/src/Network/UdpConnection.cpp:52–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52bool UdpConnection::connect(IpAddress ip, uint16_t port)
53{
54 if(udp == nullptr) {
55 if(!initialize()) {
56 return false;
57 }
58 }
59
60 if(udp->local_port == 0) {
61 udp_bind(udp, IP_ADDR_ANY, 0);
62 debug_d("UDP LocalPort: %d", udp->local_port);
63 }
64
65 debug_d("UDP connect to %s:%d", ip.toString().c_str(), port);
66 err_t res = udp_connect(udp, ip, port);
67 return res == ERR_OK;
68}
69
70bool UdpConnection::send(const char* data, int length)
71{

Callers

nothing calls this directly

Calls 3

initializeFunction · 0.85
c_strMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected