# Network library explanation

**URL:** <https://discourse.processing.org/t/network-library-explanation/10105>\
**Category:** Libraries\
**Created:** [April 8, 2019, 6:31pm UTC](https://discourse.processing.org/t/network-library-explanation/10105 "2019-04-08T18:31:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wirtex](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/wirtex/32/5701_2.png) [@Wirtex](https://discourse.processing.org/u/Wirtex)\
**Post date:** [April 8, 2019, 6:31pm UTC](https://discourse.processing.org/t/network-library-explanation/10105/1 "2019-04-08T18:31:00Z")

</div>

Hi ! I am a boy of 14years old and I code in processing but, I have some questions unsolved :

1-does the network library can connect 2 or more computer connected to the same internet or form around the globe?

2- How do get the socket to create a simple server with processing?

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [April 9, 2019, 3:32am UTC](https://discourse.processing.org/t/network-library-explanation/10105/2 "2019-04-09T03:32:20Z")

</div>

The network library allows to connect computers within the same network. I suggest you explore examples available in the forum or available in the examples provided by Processing. For instance, you can check the examples that comes with the oscP5 library (You need to install it using the contribution manager). Then you need to load two sketches, one with the server and another with the client app and make them talk to each other. You will need some minor changes (I encourage you to try to figure it out yourself so it will help you become familiar with the concepts).

To connect to the internet, it really depends on your requirements as in what you want to do. For instance if you want to save the information on a server, you can create a simple server application and communicate with it using http request. You can try free hosting options like [atspace.com](http://atspace.com) or webhost000 (I think that is what it is). You can also try GCP as it has a free tier but it requires that you provide a credit card. But no need to go online if you are still in your path to master the concepts. You can try implementing a local server first. This will also make debugging a bit easier.

For sockets, it is possible and if not available, you could implement the Java way. After all Processing is Java.

I strongly suggest you check the [happycodding.io](http://happycodding.io) website as it provides some guides to get you started.

Kf

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [April 11, 2019, 6:13am UTC](https://discourse.processing.org/t/network-library-explanation/10105/3 "2019-04-11T06:13:53Z")

</div>

Could you say more about what you are trying to do with sockets?

Recent discussions with “socket”:

[https://discourse.processing.org/search?q=socket](https://discourse.processing.org/search?q=socket)

…and there is a websockets library for Processing:

> **[alexandrainst/processing\_websockets](https://github.com/alexandrainst/processing_websockets)**
>
> A web socket library, including both server and client, for Processing - alexandrainst/processing\_websockets

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [April 11, 2019, 6:18am UTC](https://discourse.processing.org/t/network-library-explanation/10105/4 "2019-04-11T06:18:10Z")

</div>

> [@kfrajer](#):
>
> The network library allows to connect computer within the same network.

This does not mean “local network”, right? I thought it could connect to any IP address. So if you _have_ a public IP on processing server computer A, you can connect to it from processing client computer B using that IP – anywhere on earth (“the internet”).

> **[Network / Libraries](https://processing.org/reference/libraries/net/index.html)**
>
> Send and receive data over the Internet through simple clients and servers.

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [April 14, 2019, 7:44am UTC](https://discourse.processing.org/t/network-library-explanation/10105/5 "2019-04-14T07:44:00Z")

</div>

Yes, it should work to connect to the internet. This post provides some important points to consider when running into issues when connecting to the internet:

> [help with internet connection - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/520/help-with-internet-connection)

Also relevant:

- [Net library - application - Processing Forum](https://forum.processing.org/one/topic/net-library-application)
- [how to use the network library correct? - Processing Forum](https://forum.processing.org/one/topic/how-to-use-the-network-library-correct.html)
- [Sending a variabel between sketches - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/comment/85625/#Comment_85625)
- [How do I send Kinect v1 depth data over OscP5 from one computer to another? - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/25184/how-do-i-send-kinect-v1-depth-data-over-oscp5-from-one-computer-to-another#latest)
- [https://forum.processing.org/two/discussion/comment/85006/#Comment\_85006](https://forum.processing.org/two/discussion/comment/85006/#Comment_85006)
- [Live broadcast of my screen, screencapture - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/26206/live-broadcast-of-my-screen-screencapture#latest) (Video capture)
- [Looking for net library alternative - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/23978/looking-for-net-library-alternative) (Android)

Kf
