Page 1 of 1

identify data

Posted: Wed Oct 01, 2008 10:12 pm
by lydia6811
In your simple service code,you receives data from all connected devices. how can i identify the data which device come from.

RE: identify data

Posted: Wed Oct 01, 2008 10:28 pm
by Jonas
Well, if you use an asynchronous read you pass the Stream to the callback.

Regards,
Jonas

RE: identify data

Posted: Wed Oct 01, 2008 10:59 pm
by lydia6811
would you tell me how to use synchronous read ?
Thanks

RE: identify data

Posted: Wed Oct 01, 2008 11:29 pm
by Jonas
Simply exchange BeginRead with Read, though if you expect several connections or a responsive application you need to spin them off in separate threads.
This is not specific for BlueTools however, it would work exactly the same for any server application.

Regards,
Jonas