OTP 22 socket module

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

OTP 22 socket module

Andreas Schultz-3
Hi,

Is a {active, N} like delivery of data planed for the new socket or will polling the recv methods be the only way the receive data? What about non-blocking connect and accept?

My preference would be to get an active notification when data is available for receive and another one when when a non-blocking write is possible. Sending and reception should then be left to the caller.
Same goes for non-block accept and connect. Call accept/connect with a async option and get some message when the procedures finishes.

I do realize that all this could be build with a gen_server/gen_statem around socket, so I guess the real question is does it make sense to start build such a wrapper or are the plans to make async functions part of the socket module?

Thanks
Andreas
--
--
Dipl.-Inform. Andreas Schultz

----------------------- enabling your networks ----------------------
Travelping GmbH                     Phone:  +49-391-81 90 99 0
Roentgenstr. 13                     Fax:    +49-391-81 90 99 299
39108 Magdeburg                     Email:  [hidden email]
GERMANY                             Web:    http://www.travelping.com

Company Registration: Amtsgericht Stendal        Reg No.:   HRB 10578
Geschaeftsfuehrer: Holger Winkelmann          VAT ID No.: DE236673780
---------------------------------------------------------------------

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: OTP 22 socket module

Ingela Andin
Hi!

Den ons 27 mars 2019 kl 08:20 skrev Andreas Schultz <[hidden email]>:
Hi,

Is a {active, N} like delivery of data planed for the new socket or will polling the recv methods be the only way the receive data? What about non-blocking connect and accept?


It is planned to have behaviours that implement the active behaviour  but not as part of the socket module. The socket module should be the primitives. 

 
My preference would be to get an active notification when data is available for receive and another one when when a non-blocking write is possible. Sending and reception should then be left to the caller.
Same goes for non-block accept and connect. Call accept/connect with a async option and get some message when the procedures finishes.

I do realize that all this could be build with a gen_server/gen_statem around socket, so I guess the real question is does it make sense to start build such a wrapper or are the plans to make async functions part of the socket module?


Maybe Michael will have some more comments.

 
Thanks
Andreas
--
--
Dipl.-Inform. Andreas Schultz

----------------------- enabling your networks ----------------------
Travelping GmbH                     Phone:  +49-391-81 90 99 0
Roentgenstr. 13                     Fax:    +49-391-81 90 99 299
39108 Magdeburg                     Email:  [hidden email]
GERMANY                             Web:    http://www.travelping.com

Company Registration: Amtsgericht Stendal        Reg No.:   HRB 10578
Geschaeftsfuehrer: Holger Winkelmann          VAT ID No.: DE236673780
---------------------------------------------------------------------
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: OTP 22 socket module

pablo platt-3
Andreas, do you have a wrapper module or some code you can share?
I'm trying to replace a gen_udp server with the socket module.

On Fri, Mar 29, 2019 at 7:18 PM Ingela Andin <[hidden email]> wrote:
Hi!

Den ons 27 mars 2019 kl 08:20 skrev Andreas Schultz <[hidden email]>:
Hi,

Is a {active, N} like delivery of data planed for the new socket or will polling the recv methods be the only way the receive data? What about non-blocking connect and accept?


It is planned to have behaviours that implement the active behaviour  but not as part of the socket module. The socket module should be the primitives. 

 
My preference would be to get an active notification when data is available for receive and another one when when a non-blocking write is possible. Sending and reception should then be left to the caller.
Same goes for non-block accept and connect. Call accept/connect with a async option and get some message when the procedures finishes.

I do realize that all this could be build with a gen_server/gen_statem around socket, so I guess the real question is does it make sense to start build such a wrapper or are the plans to make async functions part of the socket module?


Maybe Michael will have some more comments.

 
Thanks
Andreas
--
--
Dipl.-Inform. Andreas Schultz

----------------------- enabling your networks ----------------------
Travelping GmbH                     Phone:  +49-391-81 90 99 0
Roentgenstr. 13                     Fax:    +49-391-81 90 99 299
39108 Magdeburg                     Email:  [hidden email]
GERMANY                             Web:    http://www.travelping.com

Company Registration: Amtsgericht Stendal        Reg No.:   HRB 10578
Geschaeftsfuehrer: Holger Winkelmann          VAT ID No.: DE236673780
---------------------------------------------------------------------
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: OTP 22 socket module

Andreas Schultz-3
Hi Pablo,

For demonstrating a problem I've recently written a small escript [1] that does asynchronous UDP with the socket module.
I've also converted a fairly complex application with two different UDP socket endpoints from our own implementation to the socket module [2].

For asynchronous receive you need OTP 22.1 and you definitely want an OTP version that has PR #2434 applied [3].

Regards,
Andreas


Am Mo., 28. Okt. 2019 um 20:30 Uhr schrieb pablo platt <[hidden email]>:
Andreas, do you have a wrapper module or some code you can share?
I'm trying to replace a gen_udp server with the socket module.

On Fri, Mar 29, 2019 at 7:18 PM Ingela Andin <[hidden email]> wrote:
Hi!

Den ons 27 mars 2019 kl 08:20 skrev Andreas Schultz <[hidden email]>:
Hi,

Is a {active, N} like delivery of data planed for the new socket or will polling the recv methods be the only way the receive data? What about non-blocking connect and accept?


It is planned to have behaviours that implement the active behaviour  but not as part of the socket module. The socket module should be the primitives. 

 
My preference would be to get an active notification when data is available for receive and another one when when a non-blocking write is possible. Sending and reception should then be left to the caller.
Same goes for non-block accept and connect. Call accept/connect with a async option and get some message when the procedures finishes.

I do realize that all this could be build with a gen_server/gen_statem around socket, so I guess the real question is does it make sense to start build such a wrapper or are the plans to make async functions part of the socket module?


Maybe Michael will have some more comments.

 
Thanks
Andreas
--
--
Dipl.-Inform. Andreas Schultz

----------------------- enabling your networks ----------------------
Travelping GmbH                     Phone:  +49-391-81 90 99 0
Roentgenstr. 13                     Fax:    +49-391-81 90 99 299
39108 Magdeburg                     Email:  [hidden email]
GERMANY                             Web:    http://www.travelping.com

Company Registration: Amtsgericht Stendal        Reg No.:   HRB 10578
Geschaeftsfuehrer: Holger Winkelmann          VAT ID No.: DE236673780
---------------------------------------------------------------------
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions


--

Andreas Schultz

-- 

Principal Engineer

t: +49 391 819099-224

------------------------------- enabling your networks -----------------------------

Travelping GmbH 

Roentgenstraße 13

39108 Magdeburg

Germany

t: +49 391 819099-0

f: +49 391 819099-299

e: [hidden email]

w: https://www.travelping.com/

   
Company registration: Amtsgericht Stendal  Reg. No.: HRB 10578
Geschaeftsfuehrer: Holger Winkelmann VAT ID: DE236673780

 

Reply | Threaded
Open this post in threaded view
|

Re: OTP 22 socket module

pablo platt-3
Thank you. That's very helpful.

On Tue, Oct 29, 2019 at 9:50 AM Andreas Schultz <[hidden email]> wrote:
Hi Pablo,

For demonstrating a problem I've recently written a small escript [1] that does asynchronous UDP with the socket module.
I've also converted a fairly complex application with two different UDP socket endpoints from our own implementation to the socket module [2].

For asynchronous receive you need OTP 22.1 and you definitely want an OTP version that has PR #2434 applied [3].

Regards,
Andreas


Am Mo., 28. Okt. 2019 um 20:30 Uhr schrieb pablo platt <[hidden email]>:
Andreas, do you have a wrapper module or some code you can share?
I'm trying to replace a gen_udp server with the socket module.

On Fri, Mar 29, 2019 at 7:18 PM Ingela Andin <[hidden email]> wrote:
Hi!

Den ons 27 mars 2019 kl 08:20 skrev Andreas Schultz <[hidden email]>:
Hi,

Is a {active, N} like delivery of data planed for the new socket or will polling the recv methods be the only way the receive data? What about non-blocking connect and accept?


It is planned to have behaviours that implement the active behaviour  but not as part of the socket module. The socket module should be the primitives. 

 
My preference would be to get an active notification when data is available for receive and another one when when a non-blocking write is possible. Sending and reception should then be left to the caller.
Same goes for non-block accept and connect. Call accept/connect with a async option and get some message when the procedures finishes.

I do realize that all this could be build with a gen_server/gen_statem around socket, so I guess the real question is does it make sense to start build such a wrapper or are the plans to make async functions part of the socket module?


Maybe Michael will have some more comments.

 
Thanks
Andreas
--
--
Dipl.-Inform. Andreas Schultz

----------------------- enabling your networks ----------------------
Travelping GmbH                     Phone:  +49-391-81 90 99 0
Roentgenstr. 13                     Fax:    +49-391-81 90 99 299
39108 Magdeburg                     Email:  [hidden email]
GERMANY                             Web:    http://www.travelping.com

Company Registration: Amtsgericht Stendal        Reg No.:   HRB 10578
Geschaeftsfuehrer: Holger Winkelmann          VAT ID No.: DE236673780
---------------------------------------------------------------------
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions


--

Andreas Schultz

-- 

Principal Engineer

t: +49 391 819099-224

------------------------------- enabling your networks -----------------------------

Travelping GmbH 

Roentgenstraße 13

39108 Magdeburg

Germany

t: +49 391 819099-0

f: +49 391 819099-299

e: [hidden email]

w: https://www.travelping.com/

   
Company registration: Amtsgericht Stendal  Reg. No.: HRB 10578
Geschaeftsfuehrer: Holger Winkelmann VAT ID: DE236673780