# Socket Connection To be Always alive

**URL:** <https://forum.inductiveautomation.com/t/socket-connection-to-be-always-alive/87976>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [March 27, 2024, 3:43pm UTC](https://forum.inductiveautomation.com/t/socket-connection-to-be-always-alive/87976 "2024-03-27T15:43:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subin\_Adhikari](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Subin\_Adhikari](https://forum.inductiveautomation.com/u/Subin_Adhikari)\
**Post date:** [March 27, 2024, 3:43pm UTC](https://forum.inductiveautomation.com/t/socket-connection-to-be-always-alive/87976/1 "2024-03-27T15:43:31Z")

</div>

Gurus,

I was wondering what will be the best way to keep the connection alive for the Socket Listener inside perspective.

We have a situation where we have to be a Server for a printer which will be a client, and have to keep the connection alive.

Regards.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 27, 2024, 3:49pm UTC](https://forum.inductiveautomation.com/t/socket-connection-to-be-always-alive/87976/2 "2024-03-27T15:49:29Z")

</div>

Perspective doesn't "reach out" to clients. Clients "reach out" to Ignition, with a browser, to establish a Perspective session.

Does this printer have a builtin browser that supports modern HTML5, JS, and CSS?

If not, this isn't a Perspective question. You would need to share more information about what you are trying to do.

If the printer does have such a browser, that browser would be responsible for keep-alive.

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [March 27, 2024, 3:56pm UTC](https://forum.inductiveautomation.com/t/socket-connection-to-be-always-alive/87976/3 "2024-03-27T15:56:11Z")

</div>

> [@Subin\_Adhikari](#):
>
> we have to be a Server for a printer which will be a client

This definitely sounds more like a WebDev module question. Can you confirm?

---

<div class="post-metadata">

**Author:** ![Subin\_Adhikari](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Subin\_Adhikari](https://forum.inductiveautomation.com/u/Subin_Adhikari)\
**Post date:** [March 27, 2024, 4:08pm UTC](https://forum.inductiveautomation.com/t/socket-connection-to-be-always-alive/87976/4 "2024-03-27T16:08:02Z")

</div>

The printer is trying to connect through TCP port, we can configure the IP and PORT where the printer connects to.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 27, 2024, 4:09pm UTC](https://forum.inductiveautomation.com/t/socket-connection-to-be-always-alive/87976/5 "2024-03-27T16:09:33Z")

</div>

> [@Subin\_Adhikari](#):
>
> through TCP port

Ok, but what protocol? (This is not typical behavior for a printer.)

Perhaps you should identify what kind of printer this is and point to its documentation.

---

<div class="post-metadata">

**Author:** ![Subin\_Adhikari](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Subin\_Adhikari](https://forum.inductiveautomation.com/u/Subin_Adhikari)\
**Post date:** [March 27, 2024, 4:11pm UTC](https://forum.inductiveautomation.com/t/socket-connection-to-be-always-alive/87976/6 "2024-03-27T16:11:51Z")

</div>

it should be socket, when i created a C# TCP Listener, printer is able to connect to that Listener.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 27, 2024, 4:15pm UTC](https://forum.inductiveautomation.com/t/socket-connection-to-be-always-alive/87976/7 "2024-03-27T16:15:34Z")

</div>

A socket is not a protocol. Typically, and for all common drivers, printers are the listeners, not originators, for TCP connections that print something. Why is this printer different, and how do you expect to print anything?

Please share the printer documentation.
