The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

RE: Re: An Ethernet question


  • Subject: RE: Re: An Ethernet question
  • From: i.bird@xxxx
  • Date: Tue, 16 Sep 2003 15:28:00 +0000

Thanks Mark

The from and to bit makes more sense of the jungle.

In summary in my little embedded application:
I listen to port 3639 at all times from a xAP slant.
I send to port 3639 at all times from a xAP slant.
I send from whichever port I please as there are no competing applications.

and finally
can I open another port concurrently, say port 80 for a web server? The
W3100A TCP/IP chip will support 4 concurrent sessions according to the
specs (and is this what it means)?

Thanks

Ian

Original Message:
-----------------
From: mark_harrison_uk2 <a
href="/group/xAP_developer/post?postID=7KDD9IqnAXw4HTidDOdOcyEzoo6_2YyQoh8a0r77e7uBqXlwJjYQbME_flaSHYczDt03WOkW2w5l0QAa">mph@a...</a>
Date: Tue, 16 Sep 2003 14:04:25 -0000
To: <a
href="/group/xAP_developer/post?postID=cQd7LLOVTAz5kqge36bk2NV2ZwmF6sfS61kRxOP4TqLcuwTkHTOtBQQhkX5-K9u6jJQiRU5tWFCSvOj3HahTcRKns2PvwohQ">xAP_developer@xxxxxxx</a>
Subject: [xAP_developer] Re: An Ethernet question


--- In <a
href="/group/xAP_developer/post?postID=cQd7LLOVTAz5kqge36bk2NV2ZwmF6sfS61kRxOP4TqLcuwTkHTOtBQQhkX5-K9u6jJQiRU5tWFCSvOj3HahTcRKns2PvwohQ">xAP_developer@xxxxxxx</a>,
"i.bird@t..." <Ian@M...> wrote:
> > xAP's port is 3639 if memory serves.
> > The xAP Hub opens port 3639 for listening. The xAPSender class in
my
> > framework that I snatched the code below from attempts to open a
port
> > to send on, starting from either 3639 or 3640 more likely. When
it
> > succeeds in this it has found an unused port it can write out on.
>
> > Originally I just let the sender class open any port it cared to,
but
> > Kevin I think it was suggested working up from the official xAP
port#.
>
> So, if my little device opened 3639 for listening which xAP
messages would
> it 'hear'?

OK - there are actually TWO ports involved in any message.

A sender application sends FROM an IP address / sender port
combination.
A listener application listens ON an IP address / listener port
combination.

Ports are a standard part of IP, and allow different network services
to run on the same machine. For example, port 25 is typically used
for SMTP mail, and port 80 for HTTP.

Only one application (piece of code) can listen on a given port at
any one time. For example, a web server listens on port 80 all the
time - but if you try to start up a second web server, you need to
give it a different port number.

The way that xAP gets round this problem is by having a hub. A hub
will "open port 3639 for listening". It will then relay anything
it
gets to the other xAP applications that have registered with it as
also running on that machine.

A SENDER application can send from pretty much any available port,
but must send TO port 3639. The fact that they send FROM 3639 is a
programmer choice, not something that the IP port system, or for that
matter the xAP spec requires.

On any given PC, the listener ports and the sender ports are
completely different. Just because application A is listening on port
X doesn't mean that application B can't SEND on port X. What
application B _can't_ do is LISTEN on port X.

Think of a typical UDP message as being:

- FROM: Port 1234 @ 192.168.0.1
- TO: Port 3639 @ 192.168.0.255

All that the xAP listener cares about is the port number in the TO:
field.

> If my device wanted to send data would it close 3639 for listening
and send
> on the same port or send on another port number.

You don't need to close port 3639 for listening.

> How on earth does full duplex work in this port jungle?

It doesn't. Listener port 3639 is a completely different system
resource to sender port 3639.

>
> > So the transmission port is really irrelevant, it's the listening
port
> > that's important.

Yup.

> Does this mean that all devices will hear a xAP message (or
anything else)
> sent on port 3640 (or any other) even though they are listening on
port
> 3639?

Sent FROM port 3640 or port 3641 or for that matter port 9999.
Sent TO port 3639 is the important bit.

Regards,

Mark



To unsubscribe from this group, send an email to:
<a
href="/group/xAP_developer/post?postID=TtWPbAi43sitWu3kSWDCod8qvRgElsq3HGTOAyHTeHOUJm1TfbS94hdwShyb2lFeWeo5qV5x4RdM_JGr6fDgqTY3j7-aJ-GThqSWRpQWH-aGXg">xAP_developer-unsubscribe@xxxxxxx</a>



Your use of Yahoo! Groups is subject to <a href="http://docs.yahoo.com/info/terms/";>http://docs.yahoo.com/info/terms/</a>



--------------------------------------------------------------------
mail2web - Check your email from the web at
<a href="http://mail2web.com/";>http://mail2web.com/</a> .







xAP_Development Main Index | xAP_Development Thread Index | xAP_Development Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.