mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
use original formatting
This commit is contained in:
@@ -23,8 +23,7 @@ ClientPosix::~ClientPosix() {
|
||||
}
|
||||
|
||||
bool ClientPosix::connect(IPAddress ip, uint16_t port) {
|
||||
if (connected())
|
||||
stop();
|
||||
if (connected()) stop();
|
||||
|
||||
_sockfd = ::socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (_sockfd < 0) {
|
||||
@@ -39,7 +38,7 @@ bool ClientPosix::connect(IPAddress ip, uint16_t port) {
|
||||
memset(&_host, 0, sizeof(_host));
|
||||
_host.sin_family = AF_INET;
|
||||
_host.sin_addr.s_addr = htonl(uint32_t(ip));
|
||||
_host.sin_port = htons(port);
|
||||
_host.sin_port = ::htons(port);
|
||||
|
||||
int ret = ::connect(_sockfd, (struct sockaddr *)&_host, sizeof(_host));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user