this very simple UDP client/server.. doesn't work?

Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default Re: this very simple UDP client/server.. doesn't work?

    On Mon, 04 Aug 2003 04:37:26 GMT, "Adam M." <adamm@san.rr.com> wrote
    in comp.lang.c:
    > Hi, I'm trying to get a simple UDP client/server working.
    In the future please leave comp.lang.c out of crossposts like this.
    The standard C language has no support for sockets or any sort of
    networking.
    > #include <sys/socket.h>
    > #include <netinet/in.h>
    The two headers above are not part of the C language and are off-topic
    here.

    --
    Jack Klein
    Home: [url]http://JK-Technology.Com[/url]
    FAQs for
    comp.lang.c [url]http://www.eskimo.com/~scs/C-faq/top.html[/url]
    comp.lang.c++ [url]http://www.parashift.com/c++-faq-lite/[/url]
    alt.comp.lang.learn.c-c++ [url]ftp://snurse-l.org/pub/acllc-c++/faq[/url]
    Jack Klein Guest

  2. Similar Questions and Discussions

    1. Flash Webcam client <-> client (not client <-> server<-> client)
      Dear Flash Team, supporter and regular mortals (Like myself) I am currently running a IRC chat with mostly webclients connected. We currently offer...
    2. simple client-server program ??
      Hi, how do I develop the following 'simple' program using ASP.NET webforms : a client has a text-file (aaa.txt) that has to be manipulated by...
    3. Why Doesn't This Simple SWF Work?
      http://www.uci.net/redesign/flash2.html 1) using loadVariables, I call a cgi (server-side) script that prints a content-type header, then stores...
    4. [PHP] Why wouldn't a simple script work on my server that works on other servers?
      * Thus wrote Dan Anderson (dan@mathjunkies.com): That is a sign that php isn't parsing them, so I would first make sure that my file extenstions...
    5. Simple App As A Smart Client
      Hello, "cksj" <cksanjose@hotmail.com> schrieb: Post your application in the microsoft.public.dotnet.framework.compactframework ng. Regards,...
  3. #2

    Default Re: this very simple UDP client/server.. doesn't work?

    On Mon, 04 Aug 2003 04:37:26 GMT, Adam M. <adamm@san.rr.com> wrote:
    > Hi, I'm trying to get a simple UDP client/server working.
    > [snip]
    Sorry, I'm an idiot.

    It wasn't working due to 'iptables' blocking the packets. I can't believe
    I forgot about that.

    Wellp, nothing to see here, move along. Just another useless usenet post.
    :-)
    Adam M. Guest

  4. #3

    Default Re: this very simple UDP client/server.. doesn't work?

    "Adam M." <adamm@san.rr.com> wrote in message news:<oprtc8i7drr2zrv2@news-server.san.rr.com>...
    > On Mon, 04 Aug 2003 04:37:26 GMT, Adam M. <adamm@san.rr.com> wrote:
    >
    > > Hi, I'm trying to get a simple UDP client/server working.
    > > [snip]
    > Sorry, I'm an idiot.
    >
    > It wasn't working due to 'iptables' blocking the packets. I can't believe
    > I forgot about that.
    >
    > Wellp, nothing to see here, move along. Just another useless usenet post.
    > :-)

    Hi Adam,

    e = recvfrom(s, buf, sizeof(buf), 0, NULL, NULL);

    You are using recvfrom and not even specified the IP address from
    which to receive the packet?

    I think that is the problem.

    Monisha
    Monisha Barooah Guest

  5. #4

    Default Re: this very simple UDP client/server.. doesn't work?


    "Monisha Barooah" <monishabarooah@yahoo.com> schrieb im Newsbeitrag
    news:68ef19de.0308040309.2116a269@posting.google.c om...
    > "Adam M." <adamm@san.rr.com> wrote in message
    news:<oprtc8i7drr2zrv2@news-server.san.rr.com>...
    > > On Mon, 04 Aug 2003 04:37:26 GMT, Adam M. <adamm@san.rr.com> wrote:
    > >
    > > > Hi, I'm trying to get a simple UDP client/server working.
    > > > [snip]
    > > Sorry, I'm an idiot.
    > >
    > > It wasn't working due to 'iptables' blocking the packets. I can't
    believe
    > > I forgot about that.
    > >
    > > Wellp, nothing to see here, move along. Just another useless usenet
    post.
    > > :-)
    >
    >
    > Hi Adam,
    >
    > e = recvfrom(s, buf, sizeof(buf), 0, NULL, NULL);
    >
    > You are using recvfrom and not even specified the IP address from
    > which to receive the packet?
    >
    > I think that is the problem.
    >
    > Monisha
    If he only wants to receive packets, then it's ok the specify NULL-pointers.

    However, if his server would ever like to answer the params are required,
    otherwise he would indeed have no information about the sender.

    Anyway, to my knowledge, the from- and fromlen- parameters
    in the recvfrom() call are not intended to be used as a filter to
    specify a certain address from which you want to receive packets
    now. (If you want a datagram-socket to become part of a
    one to one association you might want to call connect()
    on the serverside (!!) )

    regards ... rainer


    Rainer Temme Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139