you dont need to use bind
try without it
that is my code it connects
if(isConnected == 0){
printf("Create new netconn\n");
IP4_ADDR (&remote_ip, 192, 168, 1, 137);
xNetConn = netconn_new ( NETCONN_TCP );
rc2 = netconn_connect ( xNetConn, &remote_ip, 4444 );
if ( xNetConn == NULL ) {
printf("netconn can not be created\n");
/* No memory for new connection? */
continue;
}
}
On Friday, June 10, 2016 11:20 AM, Noam Weissman <address@hidden> wrote:
Hi,
I never used netconn so I just thinking out loud you use the same conn for listening
and to connect ?... can you it ?
here is an example that may help.
BR,
Noam.
From: lwip-users <address@hidden> on behalf of Danil Kaykov <address@hidden>
Sent: Friday, June 10, 2016 6:16 AM
To: address@hidden
Subject: [lwip-users] netconn_connect hangs
Hi all.
I'm using stm32 with FreeRTOS and trying to create tcp client.
The problem is that the netconn_connect hangs.
static void tcpecho_thread(void *arg)
{
err_t err;
struct pbuf *pbuf;
LWIP_UNUSED_ARG(arg);
/* Create a new connection identifier. */
conn = netconn_new(NETCONN_TCP);
if (conn!=NULL)
{
/* Bind connection */
err = netconn_bind(conn, &local_addr, 0);
if (err == ERR_OK)
{
err = netconn_connect(conn, &remote_addr, 8080);
// at this point
it seems the program hangs forever.
..........
Thanks advanced.
Best regards,
Danil Kaykov
address@hidden