-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP_Scripting: added socket network bindings #25687
Conversation
Garbage collect doesn't work because of the trick we used to move bindings from memory to flash. So the garbage collect function is not added in the correct place by the binding loader. You might find you can add it as a operator rather than a method. If that doesn't work we will have to mess with the generator to special case it. |
24221a1
to
0d431ed
Compare
@IamPete1 for now I've added a close() method and user will run out of sockets if they don't use it. Hopefully we can fix gc as well for automatic close |
69cbae5
to
91b6ab6
Compare
For wiki, want youtube video or dev documentation for the simple web server. |
92030c4
to
63f2a62
Compare
and use MSG_NOSIGNAL to prevent pipe errors in SITL
this allows lua scripts to properly detect a closed TCP connection
use ap_networking_printf wrapper
this fixes issues with TCP accepts being lost in web server
now getting 6.8MByte/s with NET_TESTS=4
allows scripting to set the fd for sendfile()
this allows for scripting to offload a file send to the AP_Networking library, reducing CPU costs of large file downloads
and fixed a bug with the ms time return
2af64b8
to
648731c
Compare
thanks Pete!
we no longer allow open() on directories so that we match ChibiOS FATFS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only looked at that AP_FileSystem changes
if (fs.stat(pathname, &st) != 0) { | ||
return false; | ||
} | ||
stbuf.size = st.st_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memset
This adds some simple socket bindings for scripting and a web server example script.
update: added server side scripting support
for example, this file "test.shtml":
gives this: