Skip to content

Commit c002690

Browse files
committed
add Server bind option (processing#2356) and todo notes
1 parent a6dd50f commit c002690

File tree

3 files changed

+49
-30
lines changed

3 files changed

+49
-30
lines changed

core/todo.txt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ X https://github.com/processing/processing/issues/2331
1616
X https://github.com/processing/processing/pull/2338
1717
X bug in relative moveto commands for SVG
1818
X https://github.com/processing/processing/issues/2377
19+
X Add a constructor to bind Server to a specific address
20+
X https://github.com/processing/processing/issues/2356
21+
X add disconnectEvent() to Server
22+
X https://github.com/processing/processing/pull/2466
23+
X https://github.com/processing/processing/issues/2133
24+
X don't document for now
1925

2026
cleaning
2127
o how much of com.benfry.* should go in?
@@ -46,23 +52,11 @@ X https://github.com/processing/processing/issues/2465
4652
X loadPixels problem in OpenGL
4753
X https://github.com/processing/processing/issues/2493
4854

55+
56+
high
4957
_ "Buffers have not been created" error for sketches w/o draw()
5058
_ https://github.com/processing/processing/issues/2469
5159
_ could not reproduce
52-
53-
net
54-
X add disconnectEvent() to Server
55-
X https://github.com/processing/processing/pull/2466
56-
X https://github.com/processing/processing/issues/2133
57-
_ decide how this should actually be handled
58-
_ was disconnect always there?
59-
_ will need documentation
60-
_ modernize Client/Server code to use synchronized lists
61-
_ do we let people use the public vars in Server and Client?
62-
_ are they documented?
63-
64-
65-
high
6660
_ Sketch runs with default size if size() is followed by large memory allocation
6761
_ some sort of threading issue happening here
6862
_ https://github.com/processing/processing/issues/1672
@@ -223,6 +217,9 @@ _ OpenGL offscreen requires primary surface to be OpenGL
223217
_ explain the new PGL interface
224218
_ can't really change the smoothing/options on offscreen
225219
_ is this still true?
220+
_ decide how disconnectEvent should actually be handled (and name?)
221+
_ was disconnect always there?
222+
_ will need documentation
226223

227224

228225

@@ -526,6 +523,8 @@ _ Updating graphics drivers may prevent the problem
526523
_ ellipse scaling method isn't great
527524
_ http://code.google.com/p/processing/issues/detail?id=87
528525
_ improve hint(ENABLE_DEPTH_SORT) to use proper painter's algo
526+
_ https://github.com/processing/processing/issues/90
527+
_ for begin/endRaw: https://github.com/processing/processing/issues/2235
529528
_ http://code.google.com/p/processing/issues/detail?id=51
530529
_ polygon z-order depth sorting with alpha in opengl
531530
_ complete the implementation of hint() with proper implementation

java/libraries/net/src/processing/net/Server.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,25 @@ public class Server implements Runnable {
6767
* @param port port used to transfer data
6868
*/
6969
public Server(PApplet parent, int port) {
70+
this(parent, port, null);
71+
}
72+
73+
74+
/**
75+
* @param parent typically use "this"
76+
* @param port port used to transfer data
77+
* @param host when multiple NICs are in use, the ip (or name) to bind from
78+
*/
79+
public Server(PApplet parent, int port, String host) {
7080
this.parent = parent;
7181
this.port = port;
7282

7383
try {
74-
server = new ServerSocket(this.port);
84+
if (host == null) {
85+
server = new ServerSocket(this.port);
86+
} else {
87+
server = new ServerSocket(this.port, 10, InetAddress.getByName(host));
88+
}
7589
//clients = new Vector();
7690
clients = new Client[10];
7791

@@ -168,8 +182,8 @@ static public String ip() {
168182
return InetAddress.getLocalHost().getHostAddress();
169183
} catch (UnknownHostException e) {
170184
e.printStackTrace();
185+
return null;
171186
}
172-
return null;
173187
}
174188

175189

todo.txt

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ X QuickReference tool was able to bring down the environment
4141
X https://github.com/processing/processing/issues/2229
4242
X save the previous open dialog so that we return to the directory
4343
X https://github.com/processing/processing/pull/2366
44+
X "if-else" block formatting doesn't follow Processing conventions
45+
X https://github.com/processing/processing/issues/364
46+
X https://github.com/processing/processing/pull/2477
47+
X tab characters not recognized/drawn in the editor (2.1)
48+
X https://github.com/processing/processing/issues/2180
49+
X https://github.com/processing/processing/issues/2183
50+
o udp library has tabs in the text
51+
X decision to be made on nextTabStop() inside TextAreaPainter
52+
X Chinese text is overlapped in Processing 2.1 editor
53+
X https://github.com/processing/processing/issues/2173
54+
X https://github.com/processing/processing/pull/2318
55+
X https://github.com/processing/processing/pull/2323
4456

4557
earlier (2.1.2)
4658
X added get/set methods for status lines (Manindra)
@@ -49,7 +61,6 @@ X https://github.com/processing/processing/pull/2433
4961
X allow non-pde file extensions (JDF)
5062
X https://github.com/processing/processing/issues/2420
5163

52-
5364
export
5465
X incorporate new launch4j 3.4
5566
X http://sourceforge.net/projects/launch4j/files/launch4j-3/3.4/
@@ -69,21 +80,9 @@ _ OS X applications can only be exported from OS X
6980
_ embed Java only works for the current platform
7081

7182

72-
high
73-
_ tab characters not recognized/drawn in the editor (2.1)
74-
_ https://github.com/processing/processing/issues/2180
75-
_ https://github.com/processing/processing/issues/2183
76-
_ udp library has tabs in the text
77-
_ decision to be made on nextTabStop() inside TextAreaPainter
78-
_ Chinese text is overlapped in Processing 2.1 editor
79-
_ https://github.com/processing/processing/issues/2173
80-
_ https://github.com/processing/processing/pull/2318
81-
_ https://github.com/processing/processing/pull/2323
83+
medium
8284
_ check on why 2x core.jar inside the Java folder
8385
_ maybe OS X Java can't look in subfolders? (just auto-adds things)
84-
85-
86-
medium
8786
_ display "1" is not correct in 2.1.2
8887
_ https://github.com/processing/processing/issues/2502
8988
_ re/move things from Google Code downloads
@@ -808,6 +807,13 @@ _ need to unpack InvocationTargetException in xxxxxxEvent calls
808807
_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=VideoCamera;action=display;num=1116850328#3
809808

810809

810+
LIBRARIES / Net
811+
812+
_ modernize Client/Server code to use synchronized lists
813+
_ do we let people use the public vars in Server and Client?
814+
_ are they documented?
815+
816+
811817

812818
////////////////////////////////////////////////////////////////////
813819
////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)