Hi all!
I'm trying to write a TCP client using this library as base.
I'm decoding the library and studing the HTML client, now two things I found that I don't know how to fix:
- DHCP Expire function: Is not there!!, the example implement it but is not wroted at the library.
- How the TCP socket is closed down? I can't found any call to close down the TCP connection.
For now I'm studing these:
EtherCard::clientTcpReq(&www_client_internal_result_cb,&www_client_internal_datafill_cb,hisport);
byte EtherCard::tcpSend ()
const char* EtherCard::tcpReply (byte fd)
And the close is at ??
Some example to start? or some docs about this library?
All others functions works without any isue. DHCP and DNS works realy FINE!
Best Regards!
Frank
Hi all!
The tar file at the download section have include the DHCP Expire function.
The other problem that I detected is that this lib open always a new socket, I mean create a new tcp session.
I don't have any idea if keep creating socket will be crash the Arduino.
Best Regards
Frank
In the Github repository, there is a specific (small) discussion about that.
Previously, the TCP client connections were always closed after the first packet was received from the server. If I understand correctly, multiple packet connections are not "supported" (but possible)
Line 623 in tcpip.cpp closes the connection by setting "tcp_client_statete = 4" (I believe the double "te" is a typo).
It was commented out recently in order to allow multiple packets to be received. But I have no exact idea of how you should evolve the tcp_client_state from 3 to 4 to 5.
Hi Tochinet,
I'm not using a web server, i'm using a raw socket as server that opens a new socket when a remote peer ask for be connected.
So I can debug all the TCP connections and each socket state from the server, in fact at the text that the server responds after a connections is established it gives me the remote socket number and the number (position) at the sever's socket.
The app keeps asking for new connections and do not close those that are established, so I think that if you index some value it must support several connections at the same time. I mean I see them opens so you need only know from what socket ID you send or get data.
Yeah, I was using 5 and it never open the socket, I don't recode all the web-client but if I set state in 5 (I wrote that variable as public variable at the class) it never opens.
I will try to decode where is the close function...
Best Regards!
Frank