You would need to declare the lifetimes in the foo struct declaration and then use them in the sockets field declaration. Unless you intend to/can use 'static for all 3 lifetime parameters.
I'm unclear on how to declare life times in the foo struct (not the syntax). I tried different ways of declaring them but they did not work. I would like to know the thinking pattern on how to do it.
I managed to get it to work using 'static for all lifetime parameters. The above code resulted in a compiler error where it complained that it could not infer lifetime of c.