TCP Listener

M

Marino

Hello everybody!

I am trying to write a little piece of code that would receive some
data over the network from an alarm system device. The device sends data
with a defined data packet structure. The software should listen 24 hour a
day. Is there a better way than creating a thread with listener that awaits
for a connection?

Thanks in advance!

Marino
 
A

ArunDhaJ

Does that Alarm system device supports notification service? If it
supports notification the task could be made easier.


Thanks and Regards,
ArunDhaJ
 
M

Marino

It just broadcasts events... I don't know about notification service.
How could it be done with that?

Thnaks
Marino
 
A

ArunDhaJ

I suspect the term which u use as "Broadcast events" is same as
"Notification".

Instead of creating a thread which continuously polls the device to
check whether an alarm being raised, you could create a thread which
waits for broadcast event. Upon receiving the event the code should
further proceed.

Regards
ArunDhaJ
 
M

Marino

Instead of creating a thread which continuously polls the device to
check whether an alarm being raised, you could create a thread which
waits for broadcast event. Upon receiving the event the code should
further proceed.

Well, that is the way I stated in the beginning, but I was wondering if
there is some
other way of receiving the broadcasted event other than continuously
listening on some port.

Thanks
Marino
 
I

Ignacio Machin ( .NET/ C# MVP )

Hello everybody!

I am trying to write a little piece of code that would receive some
data over the network from an alarm system device. The device sends data
with a defined data packet structure. The software should listen 24 hour a
day. Is there a better way than creating a thread with listener that awaits
for a connection?

Thanks in advance!

Marino

Hi,

not really (at least in the above scenario), what is wrong with that?
just create a windows service that does that.
 
I

Ignacio Machin ( .NET/ C# MVP )

I suspect the term which u use as "Broadcast events" is same as
"Notification".

Instead of creating a thread which continuously polls the device to
check whether an alarm being raised, you could create a thread which
waits for broadcast event. Upon receiving the event the code should
further proceed.

I think it's the other way around, is the device the one that send the
notification, his app. will only sits idle waiting for a network
connection
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top