forked from processing/processing-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.xml
More file actions
executable file
·42 lines (31 loc) · 888 Bytes
/
Copy pathClient.xml
File metadata and controls
executable file
·42 lines (31 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>Client</name>
<category>Net</category>
<subcategory></subcategory>
<usage>Application</usage>
<example>
<image></image>
<code><![CDATA[
import processing.net.*;
Client myClient;
int dataIn;
void setup() {
size(200, 200);
// Connect to the local machine at port 5204.
// This example will not run if you haven't
// previously started a server on this port.
myClient = new Client(this, "127.0.0.1", 5204);
}
void draw() {
if (myClient.available() > 0) {
dataIn = myClient.read();
}
background(dataIn);
}
]]></code>
</example>
<description><![CDATA[
A client connects to a server and sends data back and forth. If anything goes wrong with the connection, for example the host is not there or is listening on a different port, an exception is thrown.
]]></description>
</root>