Menu

#34 send() needs arg to specify a file(port) to send on

open
nobody
None
5
2007-02-10
2007-02-10
No

after f:=open(port,"nua") and select()
one could receive packets from several sources.
for a dns proxy, they expect replies from port 53;
many refuse to use replies from other ports.
these must often be sent out of order with send()
in order to specify the send address.

send() is currently opening a new socket (on a new port).
It needs to work like write() accepting optionally a file
(which must be a UDP socket) to send on the file's port.

Discussion

  • Charles Evans

    Charles Evans - 2007-02-10

    Logged In: YES
    user_id=436876
    Originator: YES

    should the socket created by send()
    be closed if the send fails?
    rposix.r: close(f) is NOT done if sendto() fails.

     
  • Nobody/Anonymous

    Logged In: NO

    to clarify, should send() _without_ a file arg call close(f)?
    I recall older versions using up all my ports after awhile.
    (send(f,msg) should of course not close f.)

     

Log in to post a comment.