Y
yofnik
I need to write a client application that polls a smart device for its
data on a regular basis. The device only accepts one TCP connection at
a time on a single port. The device is a peice of hardware that just
returns its data when it receives a request. I have no control over the
design of the device.
I want to allow multiple clients to connect to a device. However,
since the device only accepts one connection on a single port, I have a
few problems. Basically, the two options that I see are:
1. Create a proxy application that maintains a persistent connection to
the device and accepts multiple connections from the client
application. I would prefer to avoid this if possible to reduce the
complexity for the end user.
2. Open and close a connection with each request. Hopefully the number
of clients won't get too large to the point where connection requests
timeout. Just FYI...the data is relatively small and the most a single
client will request data is once a second.
Which method is my best bet? I am thinking for a small number of
clients, option 2 will be sufficient. What is the overhead of opening
and closing a connection for each request if the data packet is small?
If the clients request data at most once a second, at what point will I
have to worry about having too many connections? FYI...The client and
the device will be on the same local network.
Any advice is appreciated. Thanks!
data on a regular basis. The device only accepts one TCP connection at
a time on a single port. The device is a peice of hardware that just
returns its data when it receives a request. I have no control over the
design of the device.
I want to allow multiple clients to connect to a device. However,
since the device only accepts one connection on a single port, I have a
few problems. Basically, the two options that I see are:
1. Create a proxy application that maintains a persistent connection to
the device and accepts multiple connections from the client
application. I would prefer to avoid this if possible to reduce the
complexity for the end user.
2. Open and close a connection with each request. Hopefully the number
of clients won't get too large to the point where connection requests
timeout. Just FYI...the data is relatively small and the most a single
client will request data is once a second.
Which method is my best bet? I am thinking for a small number of
clients, option 2 will be sufficient. What is the overhead of opening
and closing a connection for each request if the data packet is small?
If the clients request data at most once a second, at what point will I
have to worry about having too many connections? FYI...The client and
the device will be on the same local network.
Any advice is appreciated. Thanks!