socket creation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • udayahirwal2@gmail.com

    socket creation

    Can i create 4 sockets on same ip address with different portnumbers.
    I am working on windows mobile.
  • Flash Gordon

    #2
    Re: socket creation

    udayahirwal2@gm ail.com wrote, On 05/05/08 14:24:
    Can i create 4 sockets on same ip address with different portnumbers.
    I am working on windows mobile.
    You will have to ask in one of the Windows groups since this is system
    specific.
    --
    Flash Gordon

    Comment

    • Antoninus Twink

      #3
      Re: socket creation

      On 5 May 2008 at 13:24, udayahirwal2@gm ail.com wrote:
      Can i create 4 sockets on same ip address with different portnumbers.
      I am working on windows mobile.
      There's no reason why you shouldn't be able to. Why don't you post a
      snippet of whatever code isn't working?

      Comment

      • Keith Thompson

        #4
        Re: socket creation

        udayahirwal2@gm ail.com writes:
        Can i create 4 sockets on same ip address with different portnumbers.
        I am working on windows mobile.
        By now you may have seen a followup from "Antoninus Twink" inviting
        you to post your code here. Please don't. You'll get much better
        answers if you post to a newsgroup that discusses your operating
        system. Sockets are not a feature of the C language.

        --
        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

        • =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?=

          #5
          Re: socket creation

          On May 5, 2:24 pm, udayahirw...@gm ail.com wrote:
          Can i create 4 sockets on same ip address with different portnumbers.
          I am working on windows mobile.
          Yes, you certainly can, and you can do it portably so that your code
          will compile for Linux, Windows, Solaris, Playstation 3, what have
          you.

          You'll need to use a cross-platform library for doing so, the big two
          being pCap and "Berkeley sockets".

          Comment

          • Walter Roberson

            #6
            Re: socket creation

            In article <4458e116-2d6d-4554-aa4d-9616d2df4344@l4 2g2000hsc.googl egroups.com>,
            =?ISO-8859-1?Q?Tom=E1s_=D3 _h=C9ilidhe?= <toe@lavabit.co mwrote:
            >On May 5, 2:24=A0pm, udayahirw...@gm ail.com wrote:
            >Can i create 4 sockets on same ip address with different portnumbers.
            >I am working on windows mobile.
            >Yes, you certainly can, and you can do it portably so that your code
            >will compile for Linux, Windows, Solaris, Playstation 3, what have
            >you.
            >You'll need to use a cross-platform library for doing so, the big two
            >being pCap and "Berkeley sockets".
            If by pCap you refer to http://sourceforge.net/projects/libpcap/
            then:

            Operating System : All POSIX (Linux/BSD/UNIX-like OSes)

            There is WinPcap, which appears to be a port that extends support
            to MS Windows.

            But to my mind, "what have you" includes operating systems such
            as PalmOS, which is not Posix nor MS Windows, but does include
            TCP/IP. Your "what have you" appears to be overly general.

            --
            "They called it golf because all the other four letter words
            were taken." -- Walter Hagen

            Comment

            • Flash Gordon

              #7
              Re: socket creation

              Walter Roberson wrote, On 05/05/08 18:37:
              In article <4458e116-2d6d-4554-aa4d-9616d2df4344@l4 2g2000hsc.googl egroups.com>,
              =?ISO-8859-1?Q?Tom=E1s_=D3 _h=C9ilidhe?= <toe@lavabit.co mwrote:
              >On May 5, 2:24=A0pm, udayahirw...@gm ail.com wrote:
              >>Can i create 4 sockets on same ip address with different portnumbers.
              >>I am working on windows mobile.
              >
              >Yes, you certainly can, and you can do it portably so that your code
              >will compile for Linux, Windows, Solaris, Playstation 3, what have
              >you.
              >
              >You'll need to use a cross-platform library for doing so, the big two
              >being pCap and "Berkeley sockets".
              The Windows implementation of sockets is not quite the same as the
              Berkeley implementation.
              If by pCap you refer to http://sourceforge.net/projects/libpcap/
              then:
              >
              Operating System : All POSIX (Linux/BSD/UNIX-like OSes)
              >
              There is WinPcap, which appears to be a port that extends support
              to MS Windows.
              It does. However, WinCE, sorry, Windows Mobile, is *not* the same as
              Windows.
              But to my mind, "what have you" includes operating systems such
              as PalmOS, which is not Posix nor MS Windows, but does include
              TCP/IP. Your "what have you" appears to be overly general.
              In particular I don't believe pcap supports the target of interest to
              the OP. Asking on a Windows Mobile group would be the OPs best recourse
              as has already been mentioned.
              --
              Flash Gordon

              Comment

              • CBFalconer

                #8
                Re: socket creation

                Tomás Ó hÉilidhe wrote:
                udayahirw...@gm ail.com wrote:
                >
                >Can i create 4 sockets on same ip address with different
                >portnumbers. I am working on windows mobile.
                >
                Yes, you certainly can, and you can do it portably so that your
                code will compile for Linux, Windows, Solaris, Playstation 3,
                what have you.
                >
                You'll need to use a cross-platform library for doing so, the
                big two being pCap and "Berkeley sockets".
                Please don't reply to such off-topic queries other than to redirect
                the queryier to an appropriate newsgroup. This has nothing to do
                with C, and should go to some sort of windows newsgroup.

                --
                [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

                • cr88192

                  #9
                  Re: socket creation


                  "Tomás Ó hÉilidhe" <toe@lavabit.co mwrote in message
                  news:4458e116-2d6d-4554-aa4d-9616d2df4344@l4 2g2000hsc.googl egroups.com...
                  On May 5, 2:24 pm, udayahirw...@gm ail.com wrote:
                  >Can i create 4 sockets on same ip address with different portnumbers.
                  >I am working on windows mobile.
                  >
                  Yes, you certainly can, and you can do it portably so that your code
                  will compile for Linux, Windows, Solaris, Playstation 3, what have
                  you.
                  >
                  You'll need to use a cross-platform library for doing so, the big two
                  being pCap and "Berkeley sockets".

                  how about this:
                  cross-platform socket support is just a few #ifdef's away...

                  sadly, IME, this is often one of the "best" ways to do inter-OS portability,
                  namely because, most often, these cross-platform libraries, are rarely if
                  ever present, and even then, usually only support a few platforms and do
                  things that would not be so hard to pull off, simply by using ifdef's or or
                  occasionally swapping out source files...


                  Linux, Windows, and Solaris:
                  this should actually be fairly easy with ifdef's, since they use fairly
                  similar sockets interfaces.

                  PS3 should be likewise, since AFAIK the thing is just running linux,
                  likewise for XBox (modified windows core).

                  WinCE is also, likewise, windows... what ever differences there are in terms
                  of API calls, are usually noted in the help files (usually, it is
                  differences along the lines of special flags working, and others having no
                  effect, ...).


                  other further systems, depends on what is provided.

                  IMO, "universal portability" is an ill-advised goal anyways. often I have
                  seen a lot more damage than good done this route. usual worst case: the code
                  has to be ported.

                  worst case, if one depends too heavily on some ill-fated portability
                  library:
                  much of the app ends up having to be discarded or rewritten...


                  my personal advice is too keep as much platform-specific machinery as is
                  reasonable in small, easily replacable, source files. these can provide a
                  kind of app-specific portability layer.

                  in this case, moving between the platforms is usually a matter of using
                  different source files, and moving to a new one may involve tweaking the
                  existing ones or adding a few new ones.

                  this usually works a lot better than it is given credit for...



                  Comment

                  • cr88192

                    #10
                    Re: socket creation


                    "CBFalconer " <cbfalconer@yah oo.comwrote in message
                    news:481F95E9.5 60EE628@yahoo.c om...
                    Tomás Ó hÉilidhe wrote:
                    >udayahirw...@g mail.com wrote:
                    >>
                    >>Can i create 4 sockets on same ip address with different
                    >>portnumbers . I am working on windows mobile.
                    >>
                    >Yes, you certainly can, and you can do it portably so that your
                    >code will compile for Linux, Windows, Solaris, Playstation 3,
                    >what have you.
                    >>
                    >You'll need to use a cross-platform library for doing so, the
                    >big two being pCap and "Berkeley sockets".
                    >
                    Please don't reply to such off-topic queries other than to redirect
                    the queryier to an appropriate newsgroup. This has nothing to do
                    with C, and should go to some sort of windows newsgroup.
                    >
                    likely, one can't expect most newbs to really know the difference.
                    "well, I am writing in C, may as well ask the C people".

                    after all, many other languages (such as Java and C#, among others) include
                    things like sockets as part of the language, rather than as a 3rd party.

                    more so, a newb may not realize that most of what exists "in C" is 3rd
                    party, rather than being a part of the "C language".

                    more so, we can note that most people, may well think of programming
                    languages in analogy to natural languages (such as English), where a natural
                    language has in its propiety pretty much every concept expressable within
                    the language, rather than, say, the language owning the grammar, and all of
                    the pieces of the lexicon being 3rd party add-ons (to lookup a word, one has
                    to find the right dictionary for the right topic).

                    so, maybe one need not be too hard on newbs, or on people at least trying to
                    give worthwhile answers, even if not strictly on topic...

                    --
                    [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

                    • Eligiusz Narutowicz

                      #11
                      Re: socket creation

                      Flash Gordon <spam@flash-gordon.me.ukwri tes:
                      udayahirwal2@gm ail.com wrote, On 05/05/08 14:24:
                      >Can i create 4 sockets on same ip address with different portnumbers.
                      >I am working on windows mobile.
                      >
                      You will have to ask in one of the Windows groups since this is system
                      specific.
                      He already had his answer. Why do you assume to be answering for other
                      peoples? Do you think no C programmers here have experience in real
                      world programs?

                      Comment

                      • =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?=

                        #12
                        Re: socket creation

                        On May 6, 12:25 am, "cr88192" <cr88...@NOSPAM .hotmail.comwro te:
                        how about this:
                        cross-platform socket support is just a few #ifdef's away...
                        >
                        sadly, IME, this is often one of the "best" ways to do inter-OS portability,
                        namely because, most often, these cross-platform libraries, are rarely if
                        ever present, and even then, usually only support a few platforms and do
                        things that would not be so hard to pull off, simply by using ifdef's or or
                        occasionally swapping out source files...

                        Berkeley sockets is as common as white bread. Recently I was looking
                        into developing a networking application before I sparked a deeper
                        interest in embedded systems. When I asked around as to what network
                        library to use, I only got two responses: Berekeley Sockets or pCap.

                        Asking about the two, I was told that Berkeley Sockets is the bread
                        and butter of doing TCP or UDP communication. I was told that it's the
                        most implemented, most portable. I was told that if *any* network
                        library was available for a certain system, then Berkeley Sockets was.

                        pCap and the other hand is more suitable for Datalink Layer stuff,
                        e.g. analysing frames and handcrafting your own frames.

                        Linux, Windows, and Solaris:
                        this should actually be fairly easy with ifdef's, since they use fairly
                        similar sockets interfaces.

                        I'd got with Berekeley Sockets. Way easier, way less bug-prown to work
                        with.

                        PS3 should be likewise, since AFAIK the thing is just running linux,
                        likewise for XBox (modified windows core).

                        Berkeley again.

                        WinCE is also, likewise, windows... what ever differences there are in terms
                        of API calls, are usually noted in the help files (usually, it is
                        differences along the lines of special flags working, and others having no
                        effect, ...).
                        >
                        other further systems, depends on what is provided.

                        Again I'd go with Berkeley.

                        IMO, "universal portability" is an ill-advised goal anyways. often I have
                        seen a lot more damage than good done this route. usual worst case: the code
                        has to be ported.

                        I myself think cross-platform development is fantastic. Look at
                        Mozilla Firefox or Mozilla Thunderbird. I'd love to write an
                        application once and to have it work on all sorts of systems.

                        worst case, if one depends too heavily on some ill-fated portability
                        library:
                        much of the app ends up having to be discarded or rewritten...

                        You can make an allegation of "ill-fated" against any library. Things
                        like Berkeley Sockets and wxWidgets aren't about to die out -- they're
                        thriving.

                        my personal advice is too keep as much platform-specific machinery as is
                        reasonable in small, easily replacable, source files. these can provide a
                        kind of app-specific portability layer.

                        I beg to differ.

                        in this case, moving between the platforms is usually a matter of using
                        different source files, and moving to a new one may involve tweaking the
                        existing ones or adding a few new ones.
                        >
                        this usually works a lot better than it is given credit for...

                        But it involves writing more than one chunk of code, which in turn can
                        result in a bug only being present on one kind of system.

                        There's a great book for cross-platform programming entitled "Cross-
                        platform development in C++".

                        Comment

                        • soscpd@terra.com.br

                          #13
                          Re: socket creation

                          Hello List

                          I am working with this one:



                          Support lots of Unix's, Windows, Linux and MAC OS X. Just fine to me.

                          Regards
                          Rafael

                          Comment

                          • William Ahern

                            #14
                            Re: socket creation

                            Eligiusz Narutowicz <eligiuszdotnar u@hotmail.comwr ote:
                            Flash Gordon <spam@flash-gordon.me.ukwri tes:
                            udayahirwal2@gm ail.com wrote, On 05/05/08 14:24:
                            Can i create 4 sockets on same ip address with different portnumbers.
                            I am working on windows mobile.
                            You will have to ask in one of the Windows groups since this is system
                            specific.
                            >
                            He already had his answer. Why do you assume to be answering for other
                            peoples? Do you think no C programmers here have experience in real
                            world programs?
                            I could walk into a local 7-Eleven and run into people who could answer the
                            question. The problem is that if he is wrong, what are the odds somebody
                            else in the store will be able to correct him?

                            It's a favor to the OP to direct him to a proper newsgroup, where he can
                            obtain _better_ advice, not just _any_ advice.

                            Comment

                            • William Ahern

                              #15
                              Re: socket creation

                              cr88192 <cr88192@nospam .hotmail.comwro te:
                              <snip>
                              so, maybe one need not be too hard on newbs, or on people at least trying
                              to give worthwhile answers, even if not strictly on topic...
                              It's a disservice to answer off-topic questions, because it's misleading the
                              OP. The OP may or may not get a correct or sufficient answer. But he most
                              assuredly will lose the benefit of the remainder of the group critiquing and
                              commenting on the accuracy of any answer.

                              Such a benefit is what makes Usenet distinct from Google. That distinction
                              may be lost on people who think Usenet is just a way to get other people to
                              do your own work for you, or who have poor research/Googling skills. All the
                              more reason to make sure they realize what can actually be had, other than
                              quick and shoddy answers.

                              Comment

                              Working...