473,218 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,218 software developers and data experts.

TCP Listener

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
Jul 31 '08 #1
9 1914
Does that Alarm system device supports notification service? If it
supports notification the task could be made easier.
Thanks and Regards,
ArunDhaJ
Jul 31 '08 #2
It just broadcasts events... I don't know about notification service.
How could it be done with that?

Thnaks
Marino

"ArunDhaJ" <ar******@gmail.comwrote in message
news:76**********************************@k36g2000 pri.googlegroups.com...
Does that Alarm system device supports notification service? If it
supports notification the task could be made easier.
Thanks and Regards,
ArunDhaJ

Jul 31 '08 #3
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
Jul 31 '08 #4
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
Jul 31 '08 #5
On Jul 31, 5:42*am, "Marino" <mar...@dir.hrwrote:
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.
Jul 31 '08 #6
On Jul 31, 7:28*am, ArunDhaJ <arund...@gmail.comwrote:
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
Jul 31 '08 #7
On Thu, 31 Jul 2008 02:42:02 -0700, Marino <ma****@dir.hrwrote:
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?
Does the device require the use of TCP? If so, then setting up a listener
(whether with an explicit thread, or using an asynchronous call) is your
requirement.

If the device supports UDP, then it's possible you'd find that to be a
useful alternative, albeit possibly more complicated if you have to also
ensure that the notification was received (the device would have to expect
some sort of acknowledgement and keep resending the notification until it
receive that).

Either way should work fine.

Pete
Jul 31 '08 #8
It requires TCP.

Thank you and everybody for answers!!

Marino

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Thu, 31 Jul 2008 02:42:02 -0700, Marino <ma****@dir.hrwrote:
>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?

Does the device require the use of TCP? If so, then setting up a listener
(whether with an explicit thread, or using an asynchronous call) is your
requirement.

If the device supports UDP, then it's possible you'd find that to be a
useful alternative, albeit possibly more complicated if you have to also
ensure that the notification was received (the device would have to expect
some sort of acknowledgement and keep resending the notification until it
receive that).

Either way should work fine.

Pete

Aug 1 '08 #9
"Marino" <ma****@dir.hrwrote in message
news:g6**********@ss408.t-com.hr...
It requires TCP.
TCP doesn't do broadcasts.
>
Thank you and everybody for answers!!

Marino

"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
>On Thu, 31 Jul 2008 02:42:02 -0700, Marino <ma****@dir.hrwrote:
>>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?

Does the device require the use of TCP? If so, then setting up a
listener (whether with an explicit thread, or using an asynchronous call)
is your requirement.

If the device supports UDP, then it's possible you'd find that to be a
useful alternative, albeit possibly more complicated if you have to also
ensure that the notification was received (the device would have to
expect some sort of acknowledgement and keep resending the notification
until it receive that).

Either way should work fine.

Pete

Aug 2 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Park Yeon Jo | last post by:
About Error : ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor I installed Oracle 8.1.7 on Windows XP Professional. and I wanto connect to that server...
2
by: Cherrish Vaidiyan | last post by:
Hello all, A warm Xmas greetings to all. I have a small problem with starting up the database. Here my strategy. I have installed Oracle 9i R 2 on Red Hat 9. i created two database on this...
1
by: Cherrish Vaidiyan | last post by:
sir, I have a small error in Listener configuration.I have two system with a database in each. I am using Red Hat 9 and Oracle 9i. so i shall anme the database and system. system 1 - node2 ...
5
by: Axel Dachtler | last post by:
Hi, I have a listener problem. The listener cannot read SERVICE_NAME in TNS-Descriptor. The service-name I specified in Oracle Net Manager for this database is testdb as well. ...
1
by: UNIXNewBie | last post by:
I've just installed Oracle Standard on an XP Platform for demo. The listener was not installed. I have installed Oracle many times on 2000 server and never seen an case where the listener was...
3
by: Bill | last post by:
When vb6 Winsock.RemoteHost is set to "127.0.0.1", c# socket listener cannot hear connect request (my old vb6 winsock listener could hear it...). Why doesn't this work, and is there a work...
6
by: Steve Teeples | last post by:
I have been perplexed by how to best treat an event that spans different classes. For example, I have a form which a user inputs data. I want to broadcast that data via an event to another...
0
by: Blake | last post by:
I am trying to make a trace listener textbox that behaves like the output window in VS, in that it shows trace messages from all trace sources. I created my own listener to write to a textbox...
5
by: mivey4 | last post by:
Hi, First off, I am aware that this is a very heavily documented error and I have done my homework for throughly researching probable causes before deciding to post my problem here. At this point,...
1
by: michael ngong | last post by:
michael.john@gmx.at (Michael John) wrote in message news:<90cc4edd.0306230900.28075193@posting.google.com>... MIchael I you stated the OS and platform that could make it easier to address your...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.