buglwIP - A Lightweight TCP/IP stack - Bugs: bug #28865, Cannot close socket/netconn in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #28865: Cannot close socket/netconn in non-blocking connect

Submitted by:  Stephane Lesage <slesage>
Submitted on:  Thu 11 Feb 2010 02:02:50 PM UTC  
 
Category: TCPSeverity: 3 - Normal
Item Group: Feature RequestStatus: Fixed
Privacy: PublicAssigned to: Simon Goldschmidt <goldsimon>
Open/Closed: ClosedPlanned Release: None
lwIP version: CVS Head

Fri 12 Feb 2010 03:22:02 PM UTC, comment #3:

Fixed.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Fri 12 Feb 2010 08:43:28 AM UTC, comment #2:

Forget that last comment: it doesn't work right now since we only have one op_completed sem right now. An assert that the connect (if active) is nonblocking will be enough.

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 11 Feb 2010 05:59:24 PM UTC, comment #1:

We should check if the connect is blocking or non-blocking and abort a blocking connect first. I know this currently wouldn't happen because one netconn shall be used from one thread only, but it's not that much more code and this way, we might one day drop that limitation...

Simon Goldschmidt <goldsimon>
Project AdministratorIn charge of this item.
Thu 11 Feb 2010 02:02:50 PM UTC, original submission:

Non-blocking mode for connect is very nice and alsmost working:
One of the interesting features is to able to cancel a pending connection.
This is currently forbidden by do_delconn.

As this is supported by tcp_close(), I think we just need to enable it in do_delconn(). I tried and it seems to work.
Can you check that ?

diff -u -r1.133 api_msg.c
--- api_msg.c 9 Feb 2010 20:23:39 -0000 1.133
+++ api_msg.c 11 Feb 2010 14:01:17 -0000
@@ -764,7 +764,9 @@
do_delconn(struct api_msg_msg *msg)
{
/* @todo TCP: abort running write/connect? */
- if ((msg->conn->state != NETCONN_NONE) && (msg->conn->state != NETCONN_LISTEN)) {
+ if ((msg->conn->state != NETCONN_NONE)
+ && (msg->conn->state != NETCONN_LISTEN)
+ && (msg->conn->state != NETCONN_CONNECT)) {
/* this only happens for TCP netconns */
LWIP_ASSERT("msg->conn->type == NETCONN_TCP", msg->conn->type == NETCONN_TCP);
msg->err = ERR_INPROGRESS;

Stephane Lesage <slesage>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by goldsimon (Posted a comment)
  • -unavailable- added by slesage (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 12 Feb 2010 03:22:02 PM UTCgoldsimonItem GroupNone=>Feature Request
      StatusNone=>Fixed
      Assigned toNone=>goldsimon
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1