0
Reply

Asynchronous Socket Server

james Last

james Last

Feb 11 2006 12:28 PM
1.6k
I am writing an application that uses asynchronous sockets to get data over ethernet from embedded devices, up to 30 concurrent devices.(These devices are written in C).

My application implements an asychronous socket server while the embedded devices are the clients

When the data comes in over the socket it is eventually passed into a message queue.

A separate thread in the app is responsible for taking the data off of the queue and then processing it.

This thread and/or others will need to be able to send data back to the distributed embedded devices.

The problem i am having is how to achieve this. I'm not sure how these threads can pass data to or communicate with the asynchonous socket server to send data back to the clients. 

The MSDN example has the socket server immediately sending data back to all clients connected to it. (App is a chat spplication)

This is not what i want to do though as I have explained above. 

I know there socket server has an asychronous send method. Do i use this some way? If so how do I use it with the other threads in my app?

I'd appreciate any advice that anyone could give me.


Thanks In Advance
Macca