[bug #56593] Add callback object storage to struct netconn

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #56593] Add callback object storage to struct netconn

David GIRAULT-2
URL:
  <https://savannah.nongnu.org/bugs/?56593>

                 Summary: Add callback object storage to struct netconn
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: will
            Submitted on: Mon 08 Jul 2019 08:32:22 PM UTC
                Category: TCP
                Severity: 3 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: 2.1.1

    _______________________________________________________

Details:


Please add "void* callbackData;" to struct netconn

I use the Netconn callback API for my application and for each new lwIP
version I have added the following to the end of struct netconn, just after
netconn_callback:

  netconn_callback callback;
  void* callbackData; /* FIX needed for object storage */

I need my own object per connection and I need to store a reference to this
object in the netconn structure. I would otherwise not be able to reference my
own object when the netconn_callback triggers.

Thank you,
Will






    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56593>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56593] Add callback object storage to struct netconn

David GIRAULT-2
Follow-up Comment #1, bug #56593 (project lwip):

Seems what you need for your own app is what the socket layer uses struct
netconn's 'socket' member for. A correct solution to me would be to change
this member 'int socket' into a union providing both 'int socket' and 'void
*callback_arg', what do you think?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56593>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56593] Add callback object storage to struct netconn

David GIRAULT-2
Follow-up Comment #2, bug #56593 (project lwip):

[comment #1 comment #1:]
> Seems what you need for your own app is what the socket layer uses struct
netconn's 'socket' member for. A correct solution to me would be to change
this member 'int socket' into a union providing both 'int socket' and 'void
*callback_arg', what do you think?

[comment #1 comment #1:]
> Seems what you need for your own app is what the socket layer uses struct
netconn's 'socket' member for. A correct solution to me would be to change
this member 'int socket' into a union providing both 'int socket' and 'void
*callback_arg', what do you think?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56593>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56593] Add callback object storage to struct netconn

David GIRAULT-2
Follow-up Comment #3, bug #56593 (project lwip):


Yes, this sounds like a good suggestion. Thank you.
Sorry for the extra posts.

[comment #1 comment #1:]
> Seems what you need for your own app is what the socket layer uses struct
netconn's 'socket' member for. A correct solution to me would be to change
this member 'int socket' into a union providing both 'int socket' and 'void
*callback_arg', what do you think?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56593>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56593] Add callback object storage to struct netconn

David GIRAULT-2
Update of bug #56593 (project lwip):

                  Status:                    None => Fixed                  
             Assigned to:                    None => goldsimon              
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #4:

I've just pushed a patch that adds support for this.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56593>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel