You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: java/libraries/net/src/processing/net/Server.java
+37-6Lines changed: 37 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,16 @@
31
31
importjava.net.*;
32
32
33
33
/**
34
-
* @generate Server.xml
34
+
* ( begin auto-generated from Server.xml )
35
+
*
36
+
* A server sends and receives data to and from its associated clients
37
+
* (other programs connected to it). When a server is started, it begins
38
+
* listening for connections on the port specified by the <b>port</b>
39
+
* parameter. Computers have many ports for transferring data and some are
40
+
* commonly used so be sure to not select one of these. For example, web
41
+
* servers usually use port 80 and POP mail uses port 110.
42
+
*
43
+
* ( end auto-generated )
35
44
* @webref net
36
45
* @usage application
37
46
* @brief The server class is used to create server objects which send and receives data to and from its associated clients (other programs connected to it).
@@ -52,7 +61,6 @@ public class Server implements Runnable {
52
61
publicClient[] clients;
53
62
54
63
/**
55
-
*
56
64
* @param parent typically use "this"
57
65
* @param port port used to transfer data
58
66
*/
@@ -91,7 +99,13 @@ public Server(PApplet parent, int port) {
91
99
92
100
93
101
/**
94
-
* @generate Server_disconnect.xml
102
+
* ( begin auto-generated from Server_disconnect.xml )
103
+
*
104
+
* Disconnect a particular client.
105
+
*
106
+
* ( end auto-generated )
107
+
*
108
+
* ( end auto-generated )
95
109
* @webref server:server
96
110
* @param client the client to disconnect
97
111
*/
@@ -140,7 +154,13 @@ protected int clientIndex(Client client) {
140
154
intlastAvailable = -1;
141
155
142
156
/**
143
-
* @generate Server_available.xml
157
+
* ( begin auto-generated from Server_available.xml )
158
+
*
159
+
* Returns the next client in line with a new message.
160
+
*
161
+
* ( end auto-generated )
162
+
*
163
+
* ( end auto-generated )
144
164
* @webref server
145
165
* @usage application
146
166
*/
@@ -163,7 +183,12 @@ public Client available() {
163
183
164
184
165
185
/**
166
-
* @generate Server_stop.xml
186
+
* ( begin auto-generated from Server_stop.xml )
187
+
*
188
+
* Disconnects all clients and stops the server.
189
+
*
190
+
* ( end auto-generated )
191
+
*
167
192
* <h3>Advanced</h3>
168
193
* <p/>
169
194
* Use this to shut down the server if you finish using it while your applet
@@ -234,7 +259,13 @@ public void run() {
234
259
235
260
236
261
/**
237
-
* @generate Server_write.xml
262
+
* ( begin auto-generated from Server_write.xml )
263
+
*
264
+
* Writes a value to all the connected clients. It sends bytes out from the
0 commit comments