ESP32 NodeMCU Module – Net

Functions

  • Constants – Constants to be used in other functions: net.
  • net.createConnection()  – Creates a client.
  • net.createServer()  – Creates a server.
  • net.createUDPSocket()  – Creates an UDP socket.
  • net.multicastJoin()  – Join multicast group.
  • net.multicastLeave()  – Leave multicast group.
  • net.server:close()  – Closes the server.
  • net.server:listen()  – Listen on port from IP address.
  • net.server:getaddr()  – Returns server local address/port.
  • net.socket:close()  – Closes socket.
  • net.socket:connect()  – Connect to a remote server.
  • net.socket:dns()  – Provides DNS resolution for a hostname.
  • net.socket:getpeer()  – Retrieve port and ip of remote peer.
  • net.socket:getaddr()  – Retrieve local port and ip of socket.
  • net.socket:hold()  – Throttle data reception by placing a request to block the TCP receive function.
  • net.socket:on()  – Register callback functions for specific events.
  • net.socket:send()  – Sends data to remote peer.
  • net.socket:ttl()  – Changes or retrieves Time-To-Live value on socket.
  • net.socket:unhold()  – Unblock TCP receiving data by revocation of a preceding hold().
  • net.udpsocket:close()  – Closes UDP socket.
  • net.udpsocket:listen()  – Listen on port from IP address.
  • net.udpsocket:on()  – Register callback functions for specific events.
  • net.udpsocket:send()  – Sends data to specific remote peer.
  • net.udpsocket:dns()  – Provides DNS resolution for a hostname.
  • net.udpsocket:getaddr()  – Retrieve local port and ip of socket.
  • net.udpsocket:ttl()  – Changes or retrieves Time-To-Live value on socket.
  • net.dns.getdnsserver()  – Gets the IP address of the DNS server used to resolve hostnames.
  • net.dns.resolve()  – Resolve a hostname to an IP address.
  • net.dns.setdnsserver()  – Sets the IP of the DNS server used to resolve hostnames.

Ex : Create a server Connection

  • Creates a server using function for 30 seconds timeout net.createServer([type[, timeout]])

Ex : Receive function

Ex : Web server function


TCP Server Connection(Client)

  • Connect the WiFi Station
  • Once got IP address then run Server_Run()  Function
  • Create a connection
  • Connect the server
  • Send the Data “ArunEwolrd IOT Project” to Server

 

 


Next :

Previous :


 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

if you have any queries call us +918300026060 or WhatsApp Dismiss

0

Your Cart

%d bloggers like this: