Sockets

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • 4.4.bsd

    Sockets

    Is there any possible way to use sockets in C, so i can finish a
    instant messenger program?
  • Ian Collins

    #2
    Re: Sockets

    4.4.bsd wrote:
    Is there any possible way to use sockets in C, so i can finish a
    instant messenger program?
    Odd question, considering the basic API is in C. For details, ask on
    comp.unix.progr ammer

    --
    Ian Collins.

    Comment

    • CBFalconer

      #3
      Re: Sockets

      "4.4.bsd" wrote:
      >
      Is there any possible way to use sockets in C, so i can finish a
      instant messenger program?
      First step: Search the C standard for the word 'socket'. If
      found, read the associated text. If not found, abandon the idea or
      develop (or steal) the needed protocols somewhere.

      --
      [mail]: Chuck F (cbfalconer at maineline dot net)
      [page]: <http://cbfalconer.home .att.net>
      Try the download section.


      ** Posted from http://www.teranews.com **

      Comment

      • Keith Thompson

        #4
        Re: Sockets

        CBFalconer <cbfalconer@yah oo.comwrites:
        "4.4.bsd" wrote:
        >Is there any possible way to use sockets in C, so i can finish a
        >instant messenger program?
        >
        First step: Search the C standard for the word 'socket'. If
        found, read the associated text. If not found, abandon the idea or
        develop (or steal) the needed protocols somewhere.
        That's not a particularly useful answer. There are plenty of things
        that can be done in perfectly portable standard C that aren't
        mentioned in the standard.

        A much more useful response would be to redirect the OP to
        comp.unix.progr ammer (which, as it happens, Ian Collins already did).

        --
        Keith Thompson (The_Other_Keit h) <kst-u@mib.org>
        Nokia
        "We must do something. This is something. Therefore, we must do this."
        -- Antony Jay and Jonathan Lynn, "Yes Minister"

        Comment

        • Antoninus Twink

          #5
          Re: Sockets

          On 16 Apr 2008 at 0:08, 4.4.bsd wrote:
          Is there any possible way to use sockets in C, so i can finish a
          instant messenger program?
          Yes, of course. Just
          #include <sys/types.h>
          #include <sys/socket.h>
          then use socket(), connect(), listen(), send(), etc. as required.

          Post again if you have any specific queries about any of the socket
          functions, or how they're used.

          Comment

          • vippstar@gmail.com

            #6
            Re: Sockets

            On Apr 16, 8:20 am, CBFalconer <cbfalco...@yah oo.comwrote:
            "4.4.bsd" wrote:
            >
            Is there any possible way to use sockets in C, so i can finish a
            instant messenger program?
            >
            First step: Search the C standard for the word 'socket'. If
            found, read the associated text. If not found, abandon the idea or
            develop (or steal) the needed protocols somewhere.
            Does that mean it's not possible to implement linked lists in C, since
            linked lists are not mentioned in the standard?
            Steal is a heavy word. It's certainly not stealing to use a free POSIX
            implementation of BSD sockets (which most unix systems have)

            Comment

            • jacob navia

              #7
              Re: Sockets

              Antoninus Twink wrote:
              On 16 Apr 2008 at 0:08, 4.4.bsd wrote:
              >Is there any possible way to use sockets in C, so i can finish a
              >instant messenger program?
              >
              Yes, of course. Just
              #include <sys/types.h>
              #include <sys/socket.h>
              then use socket(), connect(), listen(), send(), etc. as required.
              >
              Post again if you have any specific queries about any of the socket
              functions, or how they're used.
              >
              Under windows you can use the sockets interface provided by
              Microsoft with the windows SDK. It is very similar to the
              Unix interface anyway.

              --
              jacob navia
              jacob at jacob point remcomp point fr
              logiciels/informatique

              Comment

              • Antoninus Twink

                #8
                Re: Sockets

                On 16 Apr 2008 at 20:53, jacob navia wrote:
                Under windows you can use the sockets interface provided by
                Microsoft with the windows SDK. It is very similar to the
                Unix interface anyway.
                By similar, don't you actually mean identical? I thought Microsoft had
                just used the BSD code directly?

                Comment

                • CBFalconer

                  #9
                  Re: Sockets

                  vippstar@gmail. com wrote:
                  CBFalconer <cbfalco...@yah oo.comwrote:
                  >"4.4.bsd" wrote:
                  >>
                  >>Is there any possible way to use sockets in C, so i can finish
                  >>a instant messenger program?
                  >>
                  >First step: Search the C standard for the word 'socket'. If
                  >found, read the associated text. If not found, abandon the idea
                  >or develop (or steal) the needed protocols somewhere.
                  >
                  Does that mean it's not possible to implement linked lists in C,
                  since linked lists are not mentioned in the standard? Steal is
                  a heavy word. It's certainly not stealing to use a free POSIX
                  implementation of BSD sockets (which most unix systems have)
                  No, my answer was not very helpful. The point is that there is
                  nothing in the C standard or library to implement sockets. You
                  have to first define what you want, and then implement it in
                  standard C code, to be on-topic in this newsgroup. Linked lists
                  are simpler, and more easily defined, but the same process
                  applies. Code to implement it will be sufficienly short for
                  publication in c.l.c.

                  Other groups, such as comp.software-eng, might be more helpful,
                  especially for sockets..

                  --
                  [mail]: Chuck F (cbfalconer at maineline dot net)
                  [page]: <http://cbfalconer.home .att.net>
                  Try the download section.

                  ** Posted from http://www.teranews.com **

                  Comment

                  • Ian Collins

                    #10
                    Re: Sockets

                    CBFalconer wrote:
                    vippstar@gmail. com wrote:
                    >CBFalconer <cbfalco...@yah oo.comwrote:
                    >>"4.4.bsd" wrote:
                    >>>
                    >>>Is there any possible way to use sockets in C, so i can finish
                    >>>a instant messenger program?
                    >>First step: Search the C standard for the word 'socket'. If
                    >>found, read the associated text. If not found, abandon the idea
                    >>or develop (or steal) the needed protocols somewhere.
                    >Does that mean it's not possible to implement linked lists in C,
                    >since linked lists are not mentioned in the standard? Steal is
                    >a heavy word. It's certainly not stealing to use a free POSIX
                    >implementati on of BSD sockets (which most unix systems have)
                    >
                    No, my answer was not very helpful.
                    Then why bother posting it?

                    More to the point, why bother posting it five hours after the OP had
                    been redirected to an appropriate group?

                    --
                    Ian Collins.

                    Comment

                    • Martin Ambuhl

                      #11
                      Re: Sockets

                      Antoninus Twink wrote:
                      On 16 Apr 2008 at 0:08, 4.4.bsd wrote:
                      >Is there any possible way to use sockets in C, so i can finish a
                      >instant messenger program?
                      >
                      Yes, of course. Just
                      #include <sys/types.h>
                      #include <sys/socket.h>
                      then use socket(), connect(), listen(), send(), etc. as required.
                      >
                      Post again if you have any specific queries about any of the socket
                      functions, or how they're used.
                      Pay no attention of Antoninus Twink. He has long established himself as
                      an antisocial troll with the goal of destroying this newsgroup. He
                      knows that _every one_ of his suggested headers and functions is
                      off-topic, and he knows that there are newsgroups devoted to sockets
                      programming and bsd where your questions have better chances of getting
                      useful answers. His invitation to you to continue posting about these
                      questions here is, in fact, an invitation to join him in this crusade to
                      destroy comp.lang.c and to join him in countless killfiles.


                      Comment

                      • Keith Thompson

                        #12
                        Re: Sockets

                        CBFalconer <cbfalconer@yah oo.comwrites:
                        vippstar@gmail. com wrote:
                        CBFalconer <cbfalco...@yah oo.comwrote:
                        "4.4.bsd" wrote:
                        >Is there any possible way to use sockets in C, so i can finish
                        >a instant messenger program?
                        >
                        First step: Search the C standard for the word 'socket'. If
                        found, read the associated text. If not found, abandon the idea
                        or develop (or steal) the needed protocols somewhere.
                        Does that mean it's not possible to implement linked lists in C,
                        since linked lists are not mentioned in the standard? Steal is
                        a heavy word. It's certainly not stealing to use a free POSIX
                        implementation of BSD sockets (which most unix systems have)
                        >
                        No, my answer was not very helpful. The point is that there is
                        nothing in the C standard or library to implement sockets. You
                        have to first define what you want, and then implement it in
                        standard C code, to be on-topic in this newsgroup. Linked lists
                        are simpler, and more easily defined, but the same process
                        applies. Code to implement it will be sufficienly short for
                        publication in c.l.c.
                        >
                        Other groups, such as comp.software-eng, might be more helpful,
                        especially for sockets..
                        Yes, the question was off-topic. Presumably the original poster
                        didn't know that. An appropriate response would have simply to
                        redirect the OP to a group where it *is* on-topic, not to send him on
                        a while goose chase to try (and fail) to find a standard C way of
                        implementing sockets.

                        If I accidentally wander into a butcher shop and ask for spark plugs,
                        just tell me where the auto parts store is. You *know* I'm not really
                        looking for spark plugs made out of meat; don't waste my time
                        suggesting that I'd be in the right place if I were.

                        And, again, I think comp.unix.progr ammer, not comp.software-eng, is
                        more likely to be the right place. Next most likely is one of the
                        Windows groups, but the user name "4.4.bsd" suggests Unix.

                        --
                        Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
                        Nokia
                        "We must do something. This is something. Therefore, we must do this."
                        -- Antony Jay and Jonathan Lynn, "Yes Minister"

                        Comment

                        • Kenny McCormack

                          #13
                          Re: Sockets

                          In article <66ncsrF2lvd5pU 1@mid.individua l.net>,
                          Martin Ambuhl <mambuhl@earthl ink.netwrote:
                          >Antoninus Twink wrote:
                          >On 16 Apr 2008 at 0:08, 4.4.bsd wrote:
                          >>Is there any possible way to use sockets in C, so i can finish a
                          >>instant messenger program?
                          >>
                          >Yes, of course. Just
                          >#include <sys/types.h>
                          >#include <sys/socket.h>
                          >then use socket(), connect(), listen(), send(), etc. as required.
                          >>
                          >Post again if you have any specific queries about any of the socket
                          >functions, or how they're used.
                          >
                          >Pay no attention of Antoninus Twink. He has long established himself as
                          >an antisocial troll
                          The absolute, gob-smacking irony of Marty Ambuhl calling anybody
                          "anti-social" is completely beyond the pale.
                          >with the goal of destroying this newsgroup. He
                          Apparently, you seem to think there is some chance of his succeeding.
                          >knows that _every one_ of his suggested headers and functions is
                          >off-topic, and he knows that there are newsgroups devoted to sockets
                          >programming and bsd where your questions have better chances of getting
                          >useful answers. His invitation to you to continue posting about these
                          >questions here is, in fact, an invitation to join him in this crusade to
                          >destroy comp.lang.c and to join him in countless killfiles.
                          Not to mention the irony of your commenting on someone you claim to have
                          killfiled. Seems your boat has sprung a leak.

                          Comment

                          • Barry Schwarz

                            #14
                            Re: Sockets

                            On Tue, 15 Apr 2008 17:08:17 -0700 (PDT), "4.4.bsd"
                            <four.fourBSD@g mail.comwrote:
                            >Is there any possible way to use sockets in C, so i can finish a
                            >instant messenger program?
                            The language itself has no support for sockets. However, there are
                            many packages which implement support for sockets by providing
                            specialized headers and run time libraries. These are of necessity
                            system specific. Ask in a newsgroup where your system is topical
                            (e.g., comp.unix.progr ammer).


                            Remove del for email

                            Comment

                            • harsha

                              #15
                              Re: Sockets

                              On Apr 16, 5:08 am, "4.4.bsd" <four.four...@g mail.comwrote:
                              Is there any possible way to use sockets in C, so i can finish a
                              instant messenger program?
                              This might be useful to you.

                              Used it for a course on Networks.

                              Comment

                              Working...