I have a multi-threaded application, where different components (running in different threads) needs to send out UDP messages. For now they all share the same Socket instance.
The socket is created as Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
and socket.Send(byte[] message)
is called from the threads. Socket.Send is the only method that is called.
Is this a bad approach? I haven't seen any problems yet, but I fear that this is not the way sockets were intended to be used.