This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 227
Expand file tree
/
Copy pathaccept.lcdoc
More file actions
103 lines (78 loc) · 3.46 KB
/
accept.lcdoc
File metadata and controls
103 lines (78 loc) · 3.46 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
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
97
98
99
100
101
102
103
Name: accept
Type: command
Syntax: accept [datagram] connections on port <portNumber> with message <callbackMessage>
Summary:
Accepts an internet connection and creates a <socket> for that
connection.
Introduced: 1.0
OS: mac, windows, linux, ios, android
Platforms: desktop, server, mobile
Security: network
Example:
accept connections on port 80 with message "connectionMade"
Example:
accept datagram connections on port 80 with message "connectionMade"
Example:
on mouseUp
accept connections on port 80 with message "connectionMade"
end mouseUp
on connectionMade pIPAddress
put "Connection made:" && pIPAddress
end connectionMade
Example:
accept connections on port 0 with message "connectionMade"
put it into tPort
Parameters:
callbackMessage:
The name of a message to be sent when a connection is made or a datagram
is received.
portNumber:
The TCP port number on which to accept connections.
The result:
An error message if the socket could not be opened.
It:
The actual port that was bound. In the case of accepting connections
on port 0 the operating system will assign a free port in its ephemeral
port range.
Description:
Use the <accept> <command> when running a <server>, to accept <TCP>
connections or <UDP> <datagram|datagrams> from other systems (or other
<process|processes> on the same system). Use the datagram option if you
want to accept UDP datagrams.
When a connection is made or a datagram is received, the <accept>
<command> creates a new <socket> that can be used to communicate with
the other system (or <process>). When using the <close socket>,
<read from socket>, or <write to socket> <command|commands>, you can
refer to this <socket> with a socket identifier that looks like this:
host:port[|connectionID]
where the connectionID is a number assigned by
the <accept> <command>. (You only need to specify the connection number
if there is more than one <socket> connected to a particular <port> and
<host>.)
The <callbackMessage> is sent to the <object(glossary)> whose <script>
contains the <accept> <command>. Either one or two
<parameter|parameters> are sent with this <message>. The first
<parameter> is the <IP address> of the system or <process> making the
connection. If a <datagram> is being accepted, the second <parameter> is
the contents of the <datagram>.
- For technical information about sockets, see [RFC
147](https://tools.ietf.org/html/rfc147)
- For technical information about UDP datagrams, see [RFC
768](https://tools.ietf.org/html/rfc768)
- For technical information about the numbers used to designate
standard ports, see the
[official IANA list of port
assignments](https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml)
and [RFC 6335](https://tools.ietf.org/html/rfc6335)
> **Note:** The <defaultNetworkInterface> <property> can be used to
specify the interface to accept connections on.
References: read from socket (command), write to socket (command),
close socket (command), open socket (command), openSockets (function),
hostAddressToName (function), hostName (function), hostAddress (function),
peerAddress (function), hostNameToAddress (function), datagram (glossary),
IP address (glossary), TCP (glossary), port (glossary),
command (glossary), socket (glossary), UDP (glossary), host (glossary),
server (glossary), message (glossary), parameter (glossary),
process (glossary), object (glossary), HTTPProxy (property),
script (property), defaultNetworkInterface (property)
Tags: networking