Hi, Jonathan! Thanks for you reply! I think you are exactly right. I did a test yesterday. I start a timer to watch if connection timeout. If timeout, I will delete the TCP_PCB, then re-create a new TCP_PCB. It worked well. But I did not know ERROR EVENT in the first. I will check it right now. Thank you very much!
Best Regards! Locke_h 2008-11-04 发件人: Jonathan Larmour 发送时间: 2008-11-04 00:41:05 收件人: Mailing list for lwIP users 抄送: 主题: Re: [lwip-users] How can I start a TCP connect retry as a client? [EMAIL PROTECTED] wrote: > Hi, Groups! > I use LwIP 1.3.0 with Raw APIs. > Now it works as a TCP client. The server is a VC program. > If the sever is start first, LwIP can connect with it OK. > If LwIP starts earlier than the server, it can not connect. > Now I have set TCP_SYNMAXRTX to 12. It is the max value. > If client start to early, it can not connect. > So I want to make the client keep connceting till the server can accept. > How can I do? When TCP_SYNMAXRTX is exceeded, the TCP error event callback will be invoked. You just have to make sure you installed something on that. If you have, then you can use that to create the PCB again, and retry. Look for mentions of TCP_EVENT in include/lwip/tcp.h to see about the callbacks. But in essence, all you need to do is set the errf callback function pointer in the TCP PCB. Jifl -- eCosCentric Limited http://www.eCosCentric.com/ The eCos experts Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No 4422071. ------["Si fractum non sit, noli id reficere"]------ Opinions==mine _______________________________________________ lwip-users mailing list [email protected]
_______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
