This file is indexed.

/usr/share/SuperCollider/HelpSource/Classes/NetAddr.schelp is in supercollider-common 1:3.6.3~repack-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
class:: NetAddr
summary:: network address
related:: Classes/OSCFunc
categories:: Control, External Control>OSC

ClassMethods::

private::initClass

method::new
create new net address.
note::To send messages internally, loopback IP is used: "127.0.0.1"::

argument::hostname
a link::Classes/String::, either an IP number (e.g. "192.168.34.56") or a hostname such as "otherHost.local".

argument::port
a port number, like 57110.

method::fromIP
create new net address using an integer IP number.

method::langPort
Get the port sclang is currently listening on (may change after a recompile).

method::localAddr
Get a NetAddr which corresponds to localhost and the port sclang is listening on.

method::disconnectAll
close all TCP connections.

method::broadcastFlag
Get or set the broadcast flag (whether or not broadcast messages can be sent).

InstanceMethods::

private::prConnect, prDisconnect, prConnectionClosed, recover

method::sendMsg
send a message without timestamp to the addr.

method::sendBundle
send a bundle with timestamp to the addr.

method::sendRaw
send a raw message without timestamp to the addr.

method::connect
open TCP connection.

argument::disconnectHandler
called when the connection is closed (either by the client or by the server).

method::disconnect
close TCP connection.

method::ip
returns the ip number (as a link::Classes/String::).
code::
n = NetAddr("localhost", 57110);
n.ip;
::

Examples::

code::
n = NetAddr("127.0.0.1", 57120); // 57120 is sclang default port
r = OSCFunc({ arg msg, time; [time, msg].postln }, '/good/news', n);

n.sendMsg("/good/news", "you", "not you");
n.sendMsg("/good/news", 1, 1.3, 77);


n.sendBundle(0.2, ["/good/news", 1, 1.3, 77]);

r.free;
n.disconnect;

// note that different NetAddr objects with the same port and ip are independent.

r = OSCFunc({ "message arrived".postln }, '/x');

n = NetAddr("127.0.0.1", 57120);
n.sendMsg("/x")


u = NetAddr("127.0.0.1", 57120);
u.sendMsg("/x");

n.disconnect

u.sendMsg("/x");

r.free;
u.disconnect;
::