# Connect two sketches on two computers

**URL:** <https://discourse.processing.org/t/connect-two-sketches-on-two-computers/7338>\
**Category:** Libraries\
**Created:** [January 8, 2019, 11:25pm UTC](https://discourse.processing.org/t/connect-two-sketches-on-two-computers/7338 "2019-01-08T23:25:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![f.m](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@f.m](https://discourse.processing.org/u/f.m)\
**Post date:** [January 8, 2019, 11:25pm UTC](https://discourse.processing.org/t/connect-two-sketches-on-two-computers/7338/1 "2019-01-08T23:25:23Z")

</div>

Hey everyone!  
I just got a little question for you. Right now I work for a project where I have to connect two Processing sketches on two computers, to send an integer between those two computers. I still found some libraries like [processing.net](http://processing.net) or the OOCSI library. Unfortunately I did not found a solution to connection two sketches on different computers with these libraries. I just can connect two sketches on one single computer.  
Maybe some of you have an idea, how to solve my problem.

Thanks,  
Felix

---

<div class="post-metadata">

**Author:** ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Post date:** [January 8, 2019, 11:39pm UTC](https://discourse.processing.org/t/connect-two-sketches-on-two-computers/7338/2 "2019-01-08T23:39:40Z")

</div>

If you have `processing.net` library¸you should also have File\>Examples\>Libraries\>Network\>SharedCanvasClient and SharedCanvasServer examples. I suggest you to get these working between computers, then base your code on them.

Also, where are these computers located in relation to each other? In a single LAN network or across a globe?

---

<div class="post-metadata">

**Author:** ![f.m](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@f.m](https://discourse.processing.org/u/f.m)\
**Post date:** [January 8, 2019, 11:44pm UTC](https://discourse.processing.org/t/connect-two-sketches-on-two-computers/7338/3 "2019-01-08T23:44:12Z")

</div>

Thanks for your quick reply!  
Both computer are connected at the same WLAN network. Do I have to connect both at the network enviroment?

---

<div class="post-metadata">

**Author:** ![Architector\_4](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/architector_4/32/813_2.png) [@Architector\_4](https://discourse.processing.org/u/Architector_4)\
**Post date:** [January 9, 2019, 12:46am UTC](https://discourse.processing.org/t/connect-two-sketches-on-two-computers/7338/4 "2019-01-09T00:46:41Z")

</div>

I don’t think so. I think it’s enough as it is - just make sure to find out server’s IP in that WLAN network, and dial  
that into the client, and I think it should work.

(yeah, not so quick reply now… .\_.)

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [January 9, 2019, 1:44am UTC](https://discourse.processing.org/t/connect-two-sketches-on-two-computers/7338/5 "2019-01-09T01:44:53Z")

</div>

I made pong using [processing.net](http://processing.net) a while back. It lags a bit, but here is the code:

> **[Quillbert/network-pong](https://github.com/Quillbert/network-pong)**
>
> Contribute to Quillbert/network-pong development by creating an account on GitHub.

  
It’s a bit messy, but it works.

---

<div class="post-metadata">

**Author:** ![f.m](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@f.m](https://discourse.processing.org/u/f.m)\
**Post date:** [January 9, 2019, 1:36pm UTC](https://discourse.processing.org/t/connect-two-sketches-on-two-computers/7338/6 "2019-01-09T13:36:32Z")

</div>

@Architector_4 @Quillbert1  
Thank a lot you for your help. It works perfect!
