-->
Page 1 of 1

Send/Receive TCP packets

PostPosted: Fri Feb 16, 2018 1:08 pm
by RIN67630
Hi folks,

I need to send receive plain TCP data packets (one byte payload only) to a given IP at a given port.

I have found the UDP library and the corresponding classes, but nothing similar to TCP.
udp.beginPacket(address, 123);
udp.write(packetBuffer, NTP_PACKET_SIZE);
udp.endPacket();

Could somebody help me how to code the same with TCP?
Thank you.

Re: Send/Receive TCP packets

PostPosted: Sun Feb 18, 2018 9:28 am
by martinayotte
Simply take that example and rip off the serial port stuff, you will end up with plain TCP server.
https://github.com/esp8266/Arduino/blob ... Serial.ino