TCPSocket with options?


in C when you create a socket, you call socket() function to get the handle and than later you call connect or bind functions.
In Xojo we can only call connect or listen and Xojo creates the socket and connects or binds.

Can we somehow get the socket creation and connect/bind in two steps?

Because I’d like to set options on the socket before connecting.

Feature request? Or do I need to write my own TCP Socket class?

The socketcore class has an Handle property that reflect the OS descriptor for the socket.
As stated in the documentation this Handle can be used for declare statements.
I haven’t tried to use Handle property to get/set socket parameters but I think that it should work.

What actually you can’t do with the current socket classes?

The problem is that before calling Connect or Listen the handle is -1.

For some use cases this can be a problem.
As usual a feature request must be created.

Please post here the feedback case number so I can add my points to the case.