Thanks
Off topic. Not portable. Cant discuss it here. Blah, blah, blah.
--
Useful clc-related links:
http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language
Isn't it a c group ? I don't understand...
> On 12 d�c, 11:52, gaze...@shell.xmission.com (Kenny McCormack)
What Kenny is trying to tell you in as objectionable a way as possible
is that your question is actually about the Berkeley sockets API
rather than about the C language. He's right - which is a novel
experience for him - but he could have been infinitely more gracious
about it. Your best bet is probably comp.unix.programmer - even if
you're developing under Win32, for a sockets question you're more
likely to get a good answer in c.u.p than elsewhere.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
"Usenet is a strange place" - dmr 29 July 1999
Sig line vacant - apply within
It was a pre-emptive strike. As you will soon find out, this newsgroup
has been taken over by a bunch of buttheads who have this totally weird
notion about what the C language is. They will be along any second now
to tell you the same thing I just told you, but in much more patronizing
and juvenile tones.
In other words, I was joking. They will not be.
And, welcome to CLC. We hope you enjoy your stay!
> In article <6ca6c384-697c-450b...@d20g2000yqh.googlegroups.com>,
> Greg2fs <gre...@gmail.com> wrote:
Indeed.
But first we need to see some of your code using malloc and the
definition of main().
--
"Avoid hyperbole at all costs, its the most destructive argument on
the planet" - Mark McIntyre in comp.lang.c
If you hang around long enough you will learn two things at least:
Who enjoys being obnoxious and disruptive.
That this is group about the C language, not about how to use
programs written in C or how to use extensions to the language to
perform system specific tasks. Since the C language as defined in the
ISO standard has no support for ports, udp, or upnp, your question
falls into the latter category. You will get much better responses if
you post the question in a group that deals with upnp.
--
Remove del for email
> On Sat, 12 Dec 2009 08:05:57 -0800 (PST), Greg2fs <gre...@gmail.com>
> wrote:
>
>>On 12 déc, 11:52, gaze...@shell.xmission.com (Kenny McCormack) wrote:
>>> In article <920a5816-48ea-430a-b1ea-a8c2709f8...@k17g2000yqh.googlegroups.com>,
>>>
>>> Greg2fs <greg...@gmail.com> wrote:
>>> >Hello, I know the port used by my udp client to forward it using upnp.
>>> >How to do ?
>>>
>>> >Thanks
>>>
>>> Off topic. Not portable. Cant discuss it here. Blah, blah, blah.
>>>
>>> --
>>> Useful clc-related links:
>>>
>>> http://en.wikipedia.org/wiki/Aspergers
>>> http://en.wikipedia.org/wiki/Clique
>>> http://en.wikipedia.org/wiki/C_programming_language
>>
>>Isn't it a c group ? I don't understand...
>
> If you hang around long enough you will learn two things at least:
>
> Who enjoys being obnoxious and disruptive.
>
> That this is group about the C language, not about how to use
> programs written in C or how to use extensions to the language to
Wrong. This group is about all C related programming as defined in its
founding charter.
There is no better group to learn about using C and assocated tools and
methods : there a many people with cross platform skills here whereas
"specific" groups tend to be filled with pedantic nit pickers with a
very blinkered view.
> perform system specific tasks. Since the C language as defined in the
> ISO standard has no support for ports, udp, or upnp, your question
What nonsense. These things are written in C more often than not and
more often than not are used using C.
> falls into the latter category. You will get much better responses if
> you post the question in a group that deals with upnp.
Would you like to name a few?
To the OP : if its C related post here. If no one knows then you can
look further afield.
Use getsockname(2).
Or, choose which port to bind to yourself instead of letting the socket
layer choose an available ephemeral port.
Please ignore the trolls who seek to disrupt this newsgroup by
restricting discussion of valid C programming topics like networking.
Exactly.
It is interesting that none of the topicality taliban have the courage
of their convictions to set up comp.lang.iso-c or comp.lang.c.iso and
see just how popular a group restricted to ISO C would be...
Indeed.
I often wonder why I am unable to see "ISO" in the group's name. It must
be there. Surely.
The C language doesn't have sockets. Some specific implementations have
sockets, but the way you use sockets varies widely from one system to another,
so there's no generic answer. If you're on a Unix-derived system, you can
probably get good answers in comp.unix.programmer, but those same answers will
be worthless to you if you're on Windows...
-s
--
Copyright 2009, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
Nonsense.
Are you trying to argue that
int socket(int domain, int type, int protocol);
is not a C API? If so, I call bullshit.
My advice would be to leave that sort of stupidity to Heathfield and
Thomson.
> If you're on a Unix-derived system, you can probably get good answers
> in comp.unix.programmer, but those same answers will be worthless to
> you if you're on Windows...
This is nonsense. Sockets are very portable - Windows also uses
Berkeley sockets.
This is a great example of something that is indisputably better
discussed in a more general group like clc, because it *isn't* specific
to Windows or to *nix.
Note that getsockname may return zero for an empehemeral socket.
It's not a portable way of finding the actual port obtained.
> Or, choose which port to bind to yourself instead of letting the socket
> layer choose an available ephemeral port.
It's best to implement you write your own loop to scan the port space
for an available port, if you want a de-facto ephemeral port /and/ know
what it is in a portable way rather than relying on getsockname.
Moreover, you can control the allocation range this way, which you must
do if your client is to have any hope of getting out through some
firewalls.
Is this Seebs guy a Heathfield sock? He has all the mannerisms and
annoying starchiness.
To be fair, their position *is* consistent and logical, given their
definition(s). It's just that their definition(s) is/are ludicrous.
To be fair, I don't *think* he is a sock. But he (Petey) certainly has
found a friend...!
I think it is fairly well documented that they suffer from the same (or
very similar) neuroses.
> This is nonsense. Sockets are very portable - Windows also uses
> Berkeley sockets.
Windows has something which looks superficially similar to the BSD
socket functions.
However, BSD sockets aren't a stand-alone API, but extensions to the Unix
API. The value returned from socket() (and accept()) is a file descriptor
(a small, non-negative integer, so you can use it as an array index),
which can be passed to read(), write(), fdopen(), close(), dup() etc.
I din't know I could use bind for a client, but it works, this way I
choose the port I want, thanks !
That's exactly my point. First of all, by posting my little thing that
started the sub-thread, I was just doing, virtually word-for-word, what
the regs would do. So, I am simply performing a service; saving them
the trouble. Second, that's how it always happens. Search the
archives. You will find innumerable, virtually endless, threads about
topicality. On and on.
Their stated goal is to minimize the traffic. Yet, they pretend to be
blithely unaware of the fact that if they either a) just ignored the
threads they don't wish to respond to or b) just gave the d*** answer,
the traffic would be much less. Preferably the later, of course, but
certainly the former is preferable to these topicality rants.
> On 2009-12-12, Greg2fs <gre...@gmail.com> wrote:
>> Isn't it a c group ? I don't understand...
>
> The C language doesn't have sockets. Some specific implementations
> have sockets, but the way you use sockets varies widely from one
> system to another,
> so there's no generic answer. If you're on a Unix-derived system,
> you can probably get good answers in comp.unix.programmer, but those
> same answers will be worthless to you if you're on Windows...
Actually, that's not the case. Windows supports the Berkeley Sockets
API so closely that it only takes a few lines of abstraction to fix
it up completely.
As several people have tried to tell you, on the particular topic
you're asking about you're likely to get more and better answers
in comp.unix.programmer.
Your question really isn't about the C language, which is what we
(try to) discuss here. There are C implementations that don't
support sockets, and there are implementations of sockets for
languages other than C.
[...]
--
Keith Thompson (The_Other_Keith) ks...@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"
Richard Heathfield says that Windows has good support for the
Berkeley Sockets API, so comp.os.ms-windows.programmer.win32 might
also be a good source of information.
> In <slrnhi7oee.4ve...@guild.seebs.net>, Seebs wrote:
>
>> On 2009-12-12, Greg2fs <gre...@gmail.com> wrote:
>>> Isn't it a c group ? I don't understand...
>>
>> The C language doesn't have sockets. Some specific implementations
>> have sockets, but the way you use sockets varies widely from one
>> system to another,
>> so there's no generic answer. If you're on a Unix-derived system,
>> you can probably get good answers in comp.unix.programmer, but those
>> same answers will be worthless to you if you're on Windows...
>
> Actually, that's not the case. Windows supports the Berkeley Sockets
> API so closely that it only takes a few lines of abstraction to fix
> it up completely.
So in some ways Seebs was right. You will get wrong answers here. But
as usual from the ones telling people not to ask here ....
Hint to the topic Nazis : if you cant help then don't. Shut up and let
others if they so wish.
Let me quote Dr. Richtie
"C offers only straightforward, single-thread control flow: tests,
loops, grouping, and subprograms, but not multiprogramming, parallel
operations, synchronization, or coroutines."
Eeerrr Dr. Ritchie.
A false assertion doesn't magically become true by dint of repetition ad
nauseam, Kiki.
The OP's question has been answered in detail here - why should he
listen to your unwelcoming and unhelpful "recommendations"?
> There are C implementations that don't support sockets, and there are
> implementations of sockets for languages other than C.
There are C implementations that don't support printf, and there are
implementations of printf for languages other than C. Are we to infer
that printf is "off topic" in your opinion?
So what? What has that got to do with an API you moron?
It also doesn't have linked lists.
What is your point?
It seems like Dr. Ritchie doesn't seem to include API's in his
(original) definition of the C Programming Language.
And yes, my grammar bites.
The people who complain that posts pointing out that something is
off-topic are adding noise to the group always fail to realise that they
are adding noise themselves.
--
Flash Gordon
Which is why I'm pretty sure most of such questions are trolls.
Phil
--
Any true emperor never needs to wear clothes. -- Devany on r.a.s.f1
>> > The C language doesn't have sockets.
>> Nonsense.
(Interestingly, while he presumably actually wrote the word, you can also
treat this as a metasyntactic summary of Twink's post.)
>> Are you trying to argue that
>> int socket(int domain, int type, int protocol);
>> is not a C API? If so, I call bullshit.
> Let me quote Dr. Richtie
>
> "C offers only straightforward, single-thread control flow: tests,
> loops, grouping, and subprograms, but not multiprogramming, parallel
> operations, synchronization, or coroutines."
To put it another way:
static int raw_to_hex(FILE *fp);
is also a C API. So's:
void parse(char *s);
Doesn't mean that they're part of the C language, or that C has those
particular features.
And those that lecture people on topicality invariably make more noise
than those asking "off topic" questions.
I am not surprised you don't see the difference between some big headed
net nanny telling people to fuck off and the people that say, no YOU
fuck off, and we ARE open to a wider variety of questions.