udp communication in PERL - TCP-IP

This is a discussion on udp communication in PERL - TCP-IP ; Do we have a recvfrom function in PERL to receive data from any source? i.e. is it possible in PERL for a client after connecting to server on PORT1 to receive data from same server on another port say PORT2 ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: udp communication in PERL

  1. udp communication in PERL

    Do we have a recvfrom function in PERL to receive data from any
    source?
    i.e. is it possible in PERL for a client after connecting to server on
    PORT1 to receive data from same server on another port say PORT2 in
    UDP communication?

  2. Re: udp communication in PERL

    On Thu, 17 Jul 2008 02:04:20 -0700 (PDT), geeta wrote:
    > Do we have a recvfrom function in PERL to receive data from any
    > source?
    > i.e. is it possible in PERL for a client after connecting to server on
    > PORT1 to receive data from same server on another port say PORT2 in
    > UDP communication?


    According to "perldoc -f recv" and "man perlipc", the Perl recv()
    function should do the job.

    BTW, you are probably better off asking in a Perl newsgroup than here.

    /Jorgen

    --
    // Jorgen Grahn \X/ snipabacken.se> R'lyeh wgah'nagl fhtagn!

  3. Re: udp communication in PERL

    Jorgen Grahn wrote:
    > On Thu, 17 Jul 2008 02:04:20 -0700 (PDT), geeta wrote:
    >> Do we have a recvfrom function in PERL to receive data from any
    >> source?
    >> i.e. is it possible in PERL for a client after connecting to server on
    >> PORT1 to receive data from same server on another port say PORT2 in
    >> UDP communication?

    >
    > According to "perldoc -f recv" and "man perlipc", the Perl recv()
    > function should do the job.


    According to the definition of 'connect' in UDP, or indeed any rational
    definition, what the OP wants is a contradiction in terms regardless of
    language.

  4. Re: udp communication in PERL

    On Jul 17, 2:04*am, geeta wrote:

    > i.e. is it possible in PERL for a client after connecting to server on
    > PORT1 to receive data from same server on another port say PORT2 in
    > UDP communication?


    Your question is hard to understand. Do not ever say "on port", say
    "from port" or "to port". Otherwise there's no way to know if you're
    talking about the source port or the destination port.

    If you're sending data to a server *to* a port, say PORT1, that server
    will normally send you data *from* PORT1. For example, a UDP echo
    server always receives data that is sent *to* port 7 and sends data
    *from* port 7. A client talking to an echo server will choose an
    arbitrary source port and send packets *to* port 7. The server will
    send replies *from* port 7 and *to* that arbitrary port.

    DS

  5. Re: udp communication in PERL

    On Fri, 18 Jul 2008 01:52:44 GMT, EJP wrote:
    > Jorgen Grahn wrote:
    >> On Thu, 17 Jul 2008 02:04:20 -0700 (PDT), geeta wrote:
    >>> Do we have a recvfrom function in PERL to receive data from any
    >>> source?
    >>> i.e. is it possible in PERL for a client after connecting to server on
    >>> PORT1 to receive data from same server on another port say PORT2 in
    >>> UDP communication?

    >>
    >> According to "perldoc -f recv" and "man perlipc", the Perl recv()
    >> function should do the job.

    >
    > According to the definition of 'connect' in UDP, or indeed any rational
    > definition, what the OP wants is a contradiction in terms regardless of
    > language.


    Yes, if you assume he wants a single socket.

    (I think I read the part "Do we have a recvfrom function in PERL to
    receive data from any source?" and translated that to "is there a way
    in Perl to find out where a datagram comes from?" -- then responded to
    that, pretending the part after the "i.e." didn't exist.)

    /Jorgen

    --
    // Jorgen Grahn \X/ snipabacken.se> R'lyeh wgah'nagl fhtagn!

+ Reply to Thread