Network library explanation

#1

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?

1 Like

#2

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 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 website as it provides some guides to get you started.

Kf

1 Like

#3

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

Recent discussions with “socket”:

https://discourse.processing.org/search?q=socket

…and there is a websockets library for Processing:

0 Likes

#4

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”).

https://processing.org/reference/libraries/net/index.html

0 Likes

#5

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:

https://forum.processing.org/two/discussion/520/help-with-internet-connection

Also relevant:

Kf

1 Like