# Allow socket:socket\_option() in gen\_tcp when inet\_backend == socket

**URL:** <https://erlangforums.com/t/allow-socket-socket-option-in-gen-tcp-when-inet-backend-socket/2105>\
**Category:** Proposals: Ideas\
**Tags:** idea, erlang-otp, socket, tcp\
**Created:** [December 2, 2022, 10:09am UTC](https://erlangforums.com/t/allow-socket-socket-option-in-gen-tcp-when-inet-backend-socket/2105 "2022-12-02T10:09:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RoadRunnr](https://erlangforums.com/user_avatar/erlangforums.com/roadrunnr/32/1397_2.png) [@RoadRunnr](https://erlangforums.com/u/RoadRunnr)\
**Post date:** [December 2, 2022, 10:09am UTC](https://erlangforums.com/t/allow-socket-socket-option-in-gen-tcp-when-inet-backend-socket/2105/1 "2022-12-02T10:09:44Z")

</div>

The socket module as much more complete, cross platform support for advanced socket options. It would be useful if those options could be used in gen\_tcp’s connect and listen methods.

Currently, only the `raw` options is supported. But the values are platform specific.

---

<div class="post-metadata">

**Author:** ![raimo](https://erlangforums.com/user_avatar/erlangforums.com/raimo/32/867_2.png) [@raimo](https://erlangforums.com/u/raimo)\
**Post date:** [December 7, 2022, 9:57am UTC](https://erlangforums.com/t/allow-socket-socket-option-in-gen-tcp-when-inet-backend-socket/2105/2 "2022-12-07T09:57:46Z")

</div>

We do not want compatibility glue in the reverse direction.

If you want the full functionality of the `socket` API; use the `socket` API.

If you really need an addition to the `gen_tcp` socket options make a suggestion that fits the socket option model of the `gen_tcp` socket options. But remember that these options should preferably be useful on all platforms while the `socket` options are allowed to be more platform dependent.

---

<div class="post-metadata">

**Author:** ![RoadRunnr](https://erlangforums.com/user_avatar/erlangforums.com/roadrunnr/32/1397_2.png) [@RoadRunnr](https://erlangforums.com/u/RoadRunnr)\
**Post date:** [December 7, 2022, 2:08pm UTC](https://erlangforums.com/t/allow-socket-socket-option-in-gen-tcp-when-inet-backend-socket/2105/3 "2022-12-07T14:08:24Z")

</div>

The problem with the gen\_tcp compatibility is that there are a lot of libraries that are using gen\_tcp internally (and transparently pass through gen\_tcp options). Without the ability to pass socket.erl options through gen\_tcp, all of those libraries would need to be changed to use socket.erl before we would be able to use any of the new socket features.

I also wouldn’t want to add new stuff to gen\_tcp. The way I would expect the socket option pass through to work is for the old gen\_tcp to throw an error if it encounters it and gen\_tcp\_socket to pass them through to socket.erl.

If a application then needs any of the new socket behavior, it can use `{inet_backend, socket}` together with new socket options.
