mirror of
https://github.com/Show-maket/EthernetMaket.git
synced 2025-05-04 07:10:18 +00:00
d
This commit is contained in:
parent
a95cc42233
commit
89c91cb68f
@ -1,15 +0,0 @@
|
|||||||
#include "TCP.h"
|
|
||||||
|
|
||||||
static EthernetMaketClient tcpSock[MAX_SOCK_NUM];
|
|
||||||
|
|
||||||
using TCP_SESSION = SOCKET;
|
|
||||||
|
|
||||||
TCP_SESSION newConnection(IPAddress ip, uint16_t port, bool nonBlock = true){
|
|
||||||
for(int i = 0; i < MAX_SOCK_NUM; i++){
|
|
||||||
if(tcpSock[i].status() == SnSR::CLOSED){
|
|
||||||
tcpSock[i].startConnection(ip, port, nonBlock);
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return MAX_SOCK_NUM;
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user