Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > how to know local port used in an udp client ?

Reply
Thread Tools

how to know local port used in an udp client ?

 
 
Kenny McCormack
Guest
Posts: n/a
 
      12-12-2009
In article <(E-Mail Removed)>,
Antoninus Twink <(E-Mail Removed)> wrote:
>On 12 Dec 2009 at 18:32, Seebs wrote:
>> The C language doesn't have sockets.

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


To be fair, their position *is* consistent and logical, given their
definition(s). It's just that their definition(s) is/are ludicrous.

 
Reply With Quote
 
 
 
 
Kenny McCormack
Guest
Posts: n/a
 
      12-12-2009
In article <hg0oga$lgb$(E-Mail Removed)-september.org>,
Richard <(E-Mail Removed)> wrote:
....
>Is this Seebs guy a Heathfield sock? He has all the mannerisms and
>annoying starchiness.


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.

 
Reply With Quote
 
 
 
 
Beej Jorgensen
Guest
Posts: n/a
 
      12-12-2009
Note the size of this "keep it on topic" subthread compared to that of
the subthread that contains the actual answer.

With a cure like this, who needs a disease?

-Beej

 
Reply With Quote
 
Nobody
Guest
Posts: n/a
 
      12-12-2009
On Sat, 12 Dec 2009 18:43:45 +0000, Antoninus Twink wrote:

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

 
Reply With Quote
 
Greg2fs
Guest
Posts: n/a
 
      12-12-2009
I don't use to talk on newsgroups from long but with all these answers
I think I will continue, and it seems than this newsgroup correspond
to my request as I get answers...

I din't know I could use bind for a client, but it works, this way I
choose the port I want, thanks !
 
Reply With Quote
 
Kenny McCormack
Guest
Posts: n/a
 
      12-12-2009
In article <hg0pll$os0$(E-Mail Removed)-september.org>,
Beej Jorgensen <(E-Mail Removed)> wrote:
>Note the size of this "keep it on topic" subthread compared to that of
>the subthread that contains the actual answer.
>
>With a cure like this, who needs a disease?
>
>-Beej
>


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.

 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      12-12-2009
Greg2fs <(E-Mail Removed)> writes:
> I don't use to talk on newsgroups from long but with all these answers
> I think I will continue, and it seems than this newsgroup correspond
> to my request as I get answers...


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) http://www.velocityreviews.com/forums/(E-Mail Removed) <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"
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      12-12-2009
Keith Thompson <(E-Mail Removed)> writes:
> Greg2fs <(E-Mail Removed)> writes:
>> I don't use to talk on newsgroups from long but with all these answers
>> I think I will continue, and it seems than this newsgroup correspond
>> to my request as I get answers...

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


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.

> 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) (E-Mail Removed) <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"
 
Reply With Quote
 
Chad
Guest
Posts: n/a
 
      12-12-2009
On Dec 12, 10:43*am, Antoninus Twink <(E-Mail Removed)> wrote:
> On 12 Dec 2009 at 18:32, Seebs wrote:
>
> > The C language doesn't have sockets.

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


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

 
Reply With Quote
 
Chad
Guest
Posts: n/a
 
      12-12-2009
On Dec 12, 2:14*pm, Chad <(E-Mail Removed)> wrote:
> On Dec 12, 10:43*am, Antoninus Twink <(E-Mail Removed)> wrote:
>
> > On 12 Dec 2009 at 18:32, Seebs wrote:

>
> > > The C language doesn't have sockets.

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

>
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
udp client: destination port unreachable question vlyamtsev@gmail.com Java 1 05-13-2007 03:53 AM
Access local port or Running local exe file =?Utf-8?B?WVNVVA==?= ASP .Net 0 01-14-2006 12:41 AM
Re: Listen in promiscuous mode (Sniffer) on UDP port 162 and copypacketsto another port Gerald Klix Python 0 10-26-2005 08:11 AM
udp (0) -> udp (0) traffic ? Tom Cisco 2 03-04-2004 06:06 PM



Advertisments