# Socket Event after receiving some message in URCap

**URL:** <https://forum.universal-robots.com/t/socket-event-after-receiving-some-message-in-urcap/7319>\
**Category:** URCap Development\
**Tags:** sockets, threads, events\
**Created:** [May 15, 2020, 8:35am UTC](https://forum.universal-robots.com/t/socket-event-after-receiving-some-message-in-urcap/7319 "2020-05-15T08:35:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon36839296](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@anon36839296](https://forum.universal-robots.com/u/anon36839296)\
**Post date:** [May 15, 2020, 8:35am UTC](https://forum.universal-robots.com/t/socket-event-after-receiving-some-message-in-urcap/7319/1 "2020-05-15T08:35:47Z")

</div>

Hi,

I use the Socket TCP IP and Port for sending and receiving the command between my application and URCap via **DataInputSteam** and **DataOutputStream**

I would like the URCap to reply back to my application after received, I guess that may need some event to handle it because I tried to reply with some command via simple loop so they can reply back correctly but during that process, the URCap will freeze itself until finish the reply loop.

Could you please suggest me how to create some event after I got some message via DataInpuStream

---

<div class="post-metadata">

**Author:** ![anon36839296](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@anon36839296](https://forum.universal-robots.com/u/anon36839296)\
**Post date:** [May 22, 2020, 4:00am UTC](https://forum.universal-robots.com/t/socket-event-after-receiving-some-message-in-urcap/7319/2 "2020-05-22T04:00:50Z")

</div>

Hi everyone,

Please help the topic as above
