equal
deleted
inserted
replaced
1 /** |
1 /** |
2 * @author cramakrishnan |
2 * @author cramakrishnan |
3 * |
3 * |
4 * Copyright (C) 2004, C. Ramakrishnan / Illposed Software |
4 * Copyright (C) 2004, C. Ramakrishnan / Illposed Software |
5 * All rights reserved. |
5 * All rights reserved. |
6 * |
6 * |
17 import java.net.*; |
17 import java.net.*; |
18 import java.io.IOException; |
18 import java.io.IOException; |
19 |
19 |
20 public abstract class OSCPort { |
20 public abstract class OSCPort { |
21 |
21 |
22 protected DatagramSocket socket; |
22 protected DatagramSocket socket; |
23 protected int port; |
23 protected int port; |
24 |
24 |
25 /** |
25 /** |
26 * The port that the SuperCollider synth engine ususally listens too |
26 * The port that the SuperCollider synth engine ususally listens too |
27 */ |
27 */ |
28 public static final int defaultSCOSCPort = 57110; |
28 public static final int defaultSCOSCPort = 57110; |
29 |
29 |
30 /** |
30 /** |
31 * The port that the SuperCollider language engine ususally listens too |
31 * The port that the SuperCollider language engine ususally listens too |
32 */ |
32 */ |
33 public static final int defaultSCLangOSCPort = 57120; |
33 public static final int defaultSCLangOSCPort = 57120; |
34 |
34 |
35 /** |
35 /** |
36 * @see java.lang.Object#finalize() |
36 * @see java.lang.Object#finalize() |
37 */ |
37 */ |
38 protected void finalize() throws Throwable { |
38 protected void finalize() throws Throwable { |
39 super.finalize(); |
39 super.finalize(); |
40 socket.close(); |
40 socket.close(); |
41 } |
41 } |
42 |
42 |
43 /** |
43 /** |
44 * Close the socket and free-up resources. It's recommended that clients call |
44 * Close the socket and free-up resources. It's recommended that clients call |
45 * this when they are done with the port. |
45 * this when they are done with the port. |
46 */ |
46 */ |
47 public void close() { |
47 public void close() { |
48 socket.close(); |
48 socket.close(); |
49 } |
49 } |
50 |
50 |
51 } |
51 } |