lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Checking if connection is still open


From: Mateusz Plocinski
Subject: [lwip-users] Checking if connection is still open
Date: Sat, 6 Jan 2007 18:07:31 +0100

Hi,
I'm building my application using FreeRTOS+lwip example from FreeRTOS
distribution (on ARM7 microcontroller). I've built an application
which works as audio server sending audio samples over TCPIP to PC.
My problem is following:
I have 2 TCP connections using API
- one for sending data
- one for receiving commands
Question is: how can I check, if it is still open? I need to know if I
can still send data over connection. Normally i was using following
statement:

while ((netconn_peer(pxNetCon, NULL, NULL) == ERR_OK)){
"send data if it is available, aquisition of next data from ADC, send
data, etc."
}

And it worked fine in situations when my app was sending much data
frequently. After disconnection on PC side, my app jumped out of the
loop and started waiting for next connection.
But when, after openning connection from PC side, my app dont send
anything, or stop sending for longer time, or if connection is closed
from PC side right after opening - my application thread still sits in
this WHILE loop after disconnect, so it cant accept next connection,
anything I can do is to reset microcontroller.

Is there any way to check the connection state? Please help, because
this problem blocks the development of my application.

Mateusz Plocinski




reply via email to

[Prev in Thread] Current Thread [Next in Thread]