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
##### Translate the host/port argument into a sequence of 5-tuples
@@ -1230,6 +1232,25 @@ Translate the host/port argument into a sequence of 5-tuples. The resulting list
1230
1232
1231
1233
#### Class Socket Methods
1232
1234
1235
+
##### Bind specified address
1236
+
1237
+
> **socket.bind(address)**
1238
+
1239
+
Bind the socket to address. The socket must not already be bound. (The format of address depends on the address family)
1240
+
1241
+
*`address` : A tuple or list containing addresses and port numbers
1242
+
1243
+
Example:
1244
+
1245
+
```
1246
+
# Bind the datacall IP to the server address
1247
+
socket.bind(("",80))
1248
+
# Bind a custom IP to the server address
1249
+
socket.bind(("192.168.0.1",80))
1250
+
```
1251
+
1252
+
#####
1253
+
1233
1254
##### Enable a server to accept connections
1234
1255
1235
1256
@@ -1243,7 +1264,7 @@ Enable a server to accept connections. The maximum number of connections can be
1243
1264
1244
1265
> **socket.accept()**
1245
1266
1246
-
Accept a connection and return a tuple. The socket must be bound to an address and listening for connections. The return value is a pair `(conn, address)`
1267
+
Accept a connection and return a tuple. The socket must be bound to an address&port and listening for connections. The return value is a pair `(conn, address, port)`
1247
1268
1248
1269
*`conn` : new socket object usable to send and receive data on the connection
1249
1270
@@ -1399,6 +1420,8 @@ Get socket status. The status values are described as follows:
1399
1420
1400
1421
Note:
1401
1422
1423
+
The BG95 platform does not support this API.
1424
+
1402
1425
If the user calls the ` socket.getsocketsta () ` after calling the ` socket.close () ` method, it returns-1 because the object resources and so on created at this point have been freed.
0 commit comments