Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
4b630c45
Commit
4b630c45
authored
Oct 20, 2015
by
danicampora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cc3200: Make socket.listen([backlog]) compliant with Python 3.5.
parent
719dca25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
cc3200/mods/modusocket.c
cc3200/mods/modusocket.c
+11
-5
No files found.
cc3200/mods/modusocket.c
View file @
4b630c45
...
@@ -185,17 +185,23 @@ STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) {
...
@@ -185,17 +185,23 @@ STATIC mp_obj_t socket_bind(mp_obj_t self_in, mp_obj_t addr_in) {
}
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_2
(
socket_bind_obj
,
socket_bind
);
STATIC
MP_DEFINE_CONST_FUN_OBJ_2
(
socket_bind_obj
,
socket_bind
);
// method socket.listen(backlog)
// method socket.listen([backlog])
STATIC
mp_obj_t
socket_listen
(
mp_obj_t
self_in
,
mp_obj_t
backlog
)
{
STATIC
mp_obj_t
socket_listen
(
mp_uint_t
n_args
,
const
mp_obj_t
*
args
)
{
mod_network_socket_obj_t
*
self
=
self_in
;
mod_network_socket_obj_t
*
self
=
args
[
0
];
int32_t
backlog
=
0
;
if
(
n_args
>
1
)
{
backlog
=
mp_obj_get_int
(
args
[
1
]);
backlog
=
(
backlog
<
0
)
?
0
:
backlog
;
}
int
_errno
;
int
_errno
;
if
(
wlan_socket_listen
(
self
,
mp_obj_get_int
(
backlog
)
,
&
_errno
)
!=
0
)
{
if
(
wlan_socket_listen
(
self
,
backlog
,
&
_errno
)
!=
0
)
{
nlr_raise
(
mp_obj_new_exception_arg1
(
&
mp_type_OSError
,
MP_OBJ_NEW_SMALL_INT
(
-
_errno
)));
nlr_raise
(
mp_obj_new_exception_arg1
(
&
mp_type_OSError
,
MP_OBJ_NEW_SMALL_INT
(
-
_errno
)));
}
}
return
mp_const_none
;
return
mp_const_none
;
}
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_
2
(
socket_listen_obj
,
socket_listen
);
STATIC
MP_DEFINE_CONST_FUN_OBJ_
VAR_BETWEEN
(
socket_listen_obj
,
1
,
2
,
socket_listen
);
// method socket.accept()
// method socket.accept()
STATIC
mp_obj_t
socket_accept
(
mp_obj_t
self_in
)
{
STATIC
mp_obj_t
socket_accept
(
mp_obj_t
self_in
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment