tcp broadcast

I am using RL-TCPnet for TCP/IP communication.
Everything works fine, but there is one problem at this time.
The controller is working as a server, so I am sending messages to whoever connects to me.
But once in a while I need to send broadcast messages to the subnet,
i.e. to the IP address x.y.z.255.
Since library function tcp_send only sends messages to the opened socket,
I couldn't find easy way to do it.
I thought about opening another socket as a client with the broadcast address
for this purpose, but this is probably not the best way to do it.

Will appreciate any suggestions.

Gennady

Parents
  • There is no such thing as a TCP broadcast. There can't be --- TCP is by definition and by design a protocol for establishing a connection between exactly one server host and one client host.

    If you want to do broadcast, multicast or any of their variations, you need to move from TCP to UDP or other IP protocol layers, possibly even all the way down to raw Ethernet.

Reply
  • There is no such thing as a TCP broadcast. There can't be --- TCP is by definition and by design a protocol for establishing a connection between exactly one server host and one client host.

    If you want to do broadcast, multicast or any of their variations, you need to move from TCP to UDP or other IP protocol layers, possibly even all the way down to raw Ethernet.

Children
More questions in this forum