Re: [lwip-users] mutex API in system layer is necessary ?

2012-05-07 Thread vincent cui
Yes, they are same ... I am confused that nobody meet this kind of problem Vincent Cui Firmware Engineer Leader Mobile: +8613482482211 Tel: +86 21 34612525x6104 Fax: +86 21 34619770 E-Mail: vincent@enlogic.com Shanghai EnLogic Electric Technology Co., Ltd. Address: 1104-1106, Building A, No.3

Re: [lwip-users] mutex API in system layer is necessary ?

2012-05-07 Thread Simon Goldschmidt
vincent cui wrote: > I use the following code to receive file from client tool, the receive > speed will be up to down after send 3 times . > Is it LWIP bug ? How in the world is this question related to the summary of your post??? Isn't that the same question you asked in your other post ("rece

Re: [lwip-users] tcp_sndbuf return 0 when sending file

2012-05-07 Thread vincent cui
Hi : I use latest LWIP1.4.x from git repo, and found that the problem of receive speed down after sending file 3 times. My code is pasted as following . My system is FreeRTOS + lwip, I think it may be lwip bug static void close_conn(struct tcp_pcb *pcb) { tcp_arg(pcb, NULL); tcp_sen

Re: [lwip-users] mutex API in system layer is necessary ?

2012-05-07 Thread vincent cui
Hi simon: I use the following code to receive file from client tool, the receive speed will be up to down after send 3 times . Is it LWIP bug ? static err_t server_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err) { if (err == ERR_OK && p != NULL) {

Re: [lwip-users] mutex API in system layer is necessary ?

2012-05-07 Thread Simon Goldschmidt
vincent cui wrote: > I had port latest lwip1.4.0 to my system, it works well . but I found some > additional api about mutex are defined in 1.4.0 > > I want to know that are they necessary ? No, as it says in sys.h: "Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores shou

[lwip-users] receive speed down after transfer a while

2012-05-07 Thread vincent cui
All: I use the latest LWIP 1.4.x from git. And try to test lwIP receive speed by RAW api as following I use tool send 2MB file, the speed is fast at first, but go to down after a while or transfer more times. Anyone know the problem ? static void close_conn(struct tcp_pcb *pcb) { tcp_ar

[lwip-users] mutex API in system layer is necessary ?

2012-05-07 Thread vincent cui
All: I had port latest lwip1.4.0 to my system, it works well . but I found some additional api about mutex are defined in 1.4.0 I want to know that are they necessary ? err_t sys_mutex_new(sys_mutex_t *mutex) { return ERR_OK; } void sys_mutex_lock(sys_mutex_t *mutex) { } void sys_m

Re: [lwip-users] LCP Termination Request steps

2012-05-07 Thread Sylvain Rochet
Hi, On Mon, May 07, 2012 at 10:15:52PM +0200, goldsi...@gmx.de wrote: > > This is not really an answer to your post, rather a clarification > about our PPP code in general: > > I know I have said this before and it sounds like a lame excuse, but > the PPP code is not our own code - we just copi

Re: [lwip-users] LCP Termination Request steps

2012-05-07 Thread goldsi...@gmx.de
Sylvain Rochet wrote: In fsm_rtermreq(), if f->state equals LS_OPENED, which is the Connection terminated by peer condition, we send a Termination Ack, which seems logical. But, in this case, we call TIMEOUT(fsm_timeout, ...), but we don't send any request at this time, what are we waiting for e

[lwip-users] LCP Termination Request steps

2012-05-07 Thread Sylvain Rochet
Hi, In fsm_rtermreq(), if f->state equals LS_OPENED, which is the Connection terminated by peer condition, we send a Termination Ack, which seems logical. But, in this case, we call TIMEOUT(fsm_timeout, ...), but we don't send any request at this time, what are we waiting for exactly ? With PP

Re: [lwip-users] Detect RST when using non blocking read.

2012-05-07 Thread Gisle Vanem
"Karlsson, Johnny" wrote: Ok, that seems much better. But one more question .. You write that there is a global variable 'errno', but isn't there one errno variable for each socket? Normally there should be no need for that since 'errno' should only be checked immediately after any socket (o

[lwip-users] Detect RST when using non blocking read.

2012-05-07 Thread Karlsson, Johnny
Hi! There doesn't seem to be a way to detect that a remote host sends a RST message when using non blocking read. In lwip_recvfrom when a host does a regular gracious shutdown this bit of code returns 0: /* We should really do some error checking here. */ LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip

Re: [lwip-users] Detect RST when using non blocking read.

2012-05-07 Thread Simon Goldschmidt
"Karlsson, Johnny" wrote: > Ok, that seems much better. But one more question .. You write that > there is a global variable 'errno', but isn't there one errno variable > for each socket? If so how do I access it? You can read that by calling getsockopt() with level SOL_SOCKET and optname SO_ER

Re: [lwip-users] Detect RST when using non blocking read.

2012-05-07 Thread Karlsson, Johnny
Ok, that seems much better. But one more question .. You write that there is a global variable 'errno', but isn't there one errno variable for each socket? If so how do I access it? The only function seems to be to get the socket (get_socket ) but that is a static method. /Johnny -Original Me

Re: [lwip-users] Detect RST when using non blocking read.

2012-05-07 Thread Simon Goldschmidt
"Karlsson, Johnny" wrote: > There doesn't seem to be a way to detect that a remote host sends a RST > message when using non blocking read. That doesn't depend on blocking or nonblocking, it's the way the socket API is defined. When a receive function returns: - 0, the remote host closed the con

Re: [lwip-users] tcp_recved

2012-05-07 Thread Simon Goldschmidt
"Bill Auerbach" wrote: > >As a general advisory, I'm with on that, Kieran. > > > >However, I think Bill's way might be correct in his very special case > >here: calling tcp_recved from the receive callback without freeing the > >received pbuf does not hurt the stack. The only problem might be runn

[lwip-users] Detect RST when using non blocking read.

2012-05-07 Thread Karlsson, Johnny
Hi! There doesn't seem to be a way to detect that a remote host sends a RST message when using non blocking read. In lwip_recvfrom when a host does a regular gracious shutdown this bit of code returns 0: /* We should really do some error checking here. */ LWIP_DEBUGF(SOCKETS_DEBUG,

Re: [lwip-users] tcp_recved

2012-05-07 Thread Bill Auerbach
>As a general advisory, I'm with on that, Kieran. > >However, I think Bill's way might be correct in his very special case >here: calling tcp_recved from the receive callback without freeing the >received pbuf does not hurt the stack. The only problem might be running >out of pbufs (so newly arrivi

[lwip-users] liwpopt.h configur for more files transfer

2012-05-07 Thread vincent cui
All: My server build in LWIP1.4.0 need receive more files (400 files) from client. I define lwipopt.h about TCP Does it make sense for up to high speed ? is there any recommend value for this application ? Thank you ... /* MEM_SIZE: the size of the heap memory. If the application will send a

Re: [lwip-users] "netconn_bind" broken for UDP connections in LwIP 1.4.0?

2012-05-07 Thread Marco Jakobs
Hi Kieran, i've sorted this out with the help of Simon. The address i've set in the bind command was also used as a listener, so i've got the "address in use" error. LwIP 1.3.x has ignored this, that was the reason why this was running before. I'm sending my data now on the existing connecti