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: Communicatiing with xplHal


  • Subject: Re: Communicatiing with xplHal
  • From: Mal Lansell <mlansell@xxxxxxxxxxxxxx>
  • Date: Tue, 31 Aug 2004 12:25:24 +0100
  • References: <FRNT7531BF2630@frontier.co.uk>

Tony Tofts wrote:

snip

>UDP is connectionless so there won't be any incoming 'connections' only
>'data'
>
>As long as you send a valid config.app or hbeat.app as a broadcast to
port
>3865 then the hub will pick it up and then start relaying messages from
port
>3865 to it from the local ip/locahost on the port specified in port=
>
>
>
I did say it was my first time programming sockets ;-)  UDP sockets
appear to work with connect, but I didn't realise they didn't work with
listen/accept!  I take it the use of broadcast is so I don't need to
know the IP of the hub?

Taking a few hints from what you have said, I did a bit of a search of
MSDN and I think I need to take the following approach:

1) I should change my code to just use sendto (rather than
connect/send), and set the address to broadcast.

2) On the receiving side, I should bind a socket to the local address
and port 50000+, call recv and just wait for data from the hub (rather
than listen/accept).

Hopefully this will work.

Mal









xPL Main Index | xPL Thread Index | xPL 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.