473,408 Members | 1,854 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,408 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 1922
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.