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: An Ethernet question


  • Subject: Re: An Ethernet question
  • From: Stuart Booth
  • Date: Thu, 11 Sep 2003 10:49:00 +0000

On Thu, 11 Sep 2003 08:52:54 -0000, "Ian Bird" <<a
href="/group/xAP_developer/post?postID=eu4ysPZ-Od-Cs2Yo_UMTBT0-nSLYWYp6ZVTVI3r8h-vumTuaIj3DpWK2oJxIxU7cU0MvGCHOQ0w-cg">Ian@M...</a>>
wrote:

>If so, when writing a PC based application do you somehow specify the
>method used to send a xAP message in the program?

I do. My framework code to send a message goes something like this:

private void Connect ()
{
int port = xAPTransportInfo.GetListeningPort();
IPEndPoint ep = new IPEndPoint(IPAddress.Broadcast, port);

UdpClient m_datagram = new UdpClient();
m_datagram.Connect(ep);
} // End of Connect

public void Send (xAPMessage message)
{
byte[] msg = Encoding.ASCII.GetBytes(message.ToRawMessageString());

m_datagram.Send(msg, msg.Length);
} // End of Send

So it's all encapsulated in the UdpClient class of the Microsoft .net
Framework. More than that I haven't really needed to know. There are
TcpClient classes as well which I use to communicate directly with my
TiVo's YAC listener.

S
--
Stuart Booth
xAPFramework.net - a reusable xAP framework for .net

<a href="http://www.xapframework.net/";>http://www.xapframework.net/</a>
<a
href="/group/xAP_developer/post?postID=VU8qUyLGYjLiuhUXhnATnDFwX9qB9mZjCW4xTKlVbuM3lrB9J8Cd5ohEXBldYHa0Csk4IeSmOOXNnfkREiQ5">stuart@x...</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.