|
From: | Kaos |
Subject: | Re: [lwip-users] Newbie question (tcp_pcb* allocation) |
Date: | Fri, 27 Feb 2004 13:17:15 +0100 |
User-agent: | Mozilla Thunderbird 0.5 (Windows/20040207) |
David Aldrich wrote:
Hi Leon Thanks for your response. So I conclude that if I want to use a simple global variable for my connection identifier (leaving aside the arguments about globals, handles etc) I should reassign the global variable with the value passed to tcp_accept(). Am I correct?
That would work, but note that the pcb from tcp_listen() is still active, since it is a newly allocated pcb you get from tcp_accept(), not the listen version transformed.
I wonder whether this could be made clearer in rawapi.txt? This document explains that tcp_listen returns a new connection identifier, but it does not explain that the identifier will change again when a connection is established.
It certainly could be made clearer, but it does state (uhm, "hint" might be more to the point) that it is a new pcb you get from tcp_accept().
Thanks again David
Regards, Andreas
[Prev in Thread] | Current Thread | [Next in Thread] |