# TCP Python Connection to VC - Processing Freeze

**URL:** <https://forum.visualcomponents.com/t/tcp-python-connection-to-vc-processing-freeze/3474>\
**Category:** Python Programming\
**Created:** [February 14, 2022, 8:28am UTC](https://forum.visualcomponents.com/t/tcp-python-connection-to-vc-processing-freeze/3474 "2022-02-14T08:28:37Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![TSy](https://forum.visualcomponents.com/user_avatar/forum.visualcomponents.com/tsy/32/761_2.png) [@TSy](https://forum.visualcomponents.com/u/TSy)\
**Post date:** [February 14, 2022, 4:44pm UTC](https://forum.visualcomponents.com/t/tcp-python-connection-to-vc-processing-freeze/3474/4 "2022-02-14T16:44:20Z")

</div>

Well, seems that successful examples of socket communication from VC python scripts have used combination of non-blocking mode, _SOCK\_DGRAM_, and _recvFrom_ in a loop with simulation-time delay() on exception instead of the _SOCK\_STREAM_ and _select_ approach you have.

The delay() call within OnRun() yields the coroutine so simulation thread can do all the other stuff.

> [@TCP/IP socket connection with python](https://forum.visualcomponents.com/t/tcp-ip-socket-connection-with-python/189):
>
> Hi, Here is an example of TCP/IP socket connection using python. We using non-blocking mode of socket connection which needs to be implemented via try-except method. All necessary codes and components attached here by. -Sicario &nbsp; [168\_TCP\_IP-Socket-Example.zip](https://forum.visualcomponents.com/uploads/short-url/1H3qf8hwCLLuXKayk7zK4uGRu3V.zip) (1.26 MB)

---

_[View the full topic](https://forum.visualcomponents.com/t/tcp-python-connection-to-vc-processing-freeze/3474)._
