-
-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathClient_write.xml
More file actions
executable file
·54 lines (41 loc) · 1.1 KB
/
Copy pathClient_write.xml
File metadata and controls
executable file
·54 lines (41 loc) · 1.1 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>write()</name>
<category>Client</category>
<subcategory>Client</subcategory>
<usage>Application</usage>
<example>
<image></image>
<code><![CDATA[
// Creates a client that sends input to a server
import processing.net.*;
Client myClient;
int clicks;
void setup() {
// Connect to the local machine at port 10002.
// This example will not run if you haven't
// previously started a server on this port.
myClient = new Client(this, "127.0.0.1", 10002);
// Say hello
myClient.write("Hi there");
}
void mouseReleased() {
// Count the number of mouse clicks:
clicks++;
// Tell the server:
myClient.write("Mouse pressed " + clicks + " times.\n");
}
void draw() {
// Change the background if the mouse is pressed
if (mousePressed) {
background(255);
} else {
background(0);
}
}
]]></code>
</example>
<description><![CDATA[
Writes data to a server specified when constructing the client, or writes data to the specific client obtained from the Server <b>available()</b> method.
]]></description>
</root>