You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The flag is already there and EthernetClass::socketBegin() already receives the socket type, but there is no way to use this without modifying the library or copying the code in socket.cpp, as all the methods working with the socket in EthernetClass are private.
I think this library should include specific IPRawClient and MacRawClient classes (and their respective servers), but in order to allow devs to expand on this without modifying the library I propose that the following socket methods be changed from private to protected.
private:// Opens a socket(TCP or UDP or IP_RAW mode)staticuint8_tsocketBegin(uint8_t protocol, uint16_t port);
staticuint8_tsocketBeginMulticast(uint8_t protocol, IPAddress ip,uint16_t port);
staticuint8_tsocketStatus(uint8_t s);
// Close socketstaticvoidsocketClose(uint8_t s);
// Establish TCP connection (Active connection)staticvoidsocketConnect(uint8_t s, uint8_t * addr, uint16_t port);
// disconnect the connectionstaticvoidsocketDisconnect(uint8_t s);
// Establish TCP connection (Passive connection)staticuint8_tsocketListen(uint8_t s);
// Send data (TCP)staticuint16_tsocketSend(uint8_t s, constuint8_t * buf, uint16_t len);
staticuint16_tsocketSendAvailable(uint8_t s);
// Receive data (TCP)staticintsocketRecv(uint8_t s, uint8_t * buf, int16_t len);
staticuint16_tsocketRecvAvailable(uint8_t s);
staticuint8_tsocketPeek(uint8_t s);
// sets up a UDP datagram, the data for which will be provided by one// or more calls to bufferData and then finally sent with sendUDP.// return true if the datagram was successfully set up, or false if there was an errorstaticboolsocketStartUDP(uint8_t s, uint8_t* addr, uint16_t port);
// copy up to len bytes of data from buf into a UDP datagram to be// sent later by sendUDP. Allows datagrams to be built up from a series of bufferData calls.// return Number of bytes successfully bufferedstaticuint16_tsocketBufferData(uint8_t s, uint16_t offset, constuint8_t* buf, uint16_t len);
// Send a UDP datagram built up from a sequence of startUDP followed by one or more// calls to bufferData.// return true if the datagram was successfully sent, or false if there was an errorstaticboolsocketSendUDP(uint8_t s);
// Initialize the "random" source port numberstaticvoidsocketPortRand(uint16_t n);
The text was updated successfully, but these errors were encountered:
The flag is already there and
EthernetClass::socketBegin()
already receives the socket type, but there is no way to use this without modifying the library or copying the code insocket.cpp
, as all the methods working with the socket inEthernetClass
are private.I think this library should include specific
IPRawClient
andMacRawClient
classes (and their respective servers), but in order to allow devs to expand on this without modifying the library I propose that the following socket methods be changed from private to protected.The text was updated successfully, but these errors were encountered: