Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
753a9653
Commit
753a9653
authored
9 years ago
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
docs/esp.socket: Remove unused file.
parent
9487b806
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/library/esp.socket.rst
+0
-82
0 additions, 82 deletions
docs/library/esp.socket.rst
with
0 additions
and
82 deletions
docs/library/esp.socket.rst
deleted
100644 → 0
+
0
−
82
View file @
9487b806
class socket -- network socket
==============================
``socket`` is an object that represents a network socket. Example usage::
socket = esp.socket()
socket.onrecv(print)
socket.connect(('207.58.139.247', 80))
socket.send('GET /testwifi/index.html HTTP/1.0\r\n\r\n')
Constructors
------------
.. class:: esp.socket()
Create and return a socket object.
TCP Methods
-----------
.. method:: socket.connect(addr)
Connect to the adress and port specified in the ``addr`` tuple.
.. method:: socket.close()
Close the connection.
.. method:: socket.accept()
Accept a single connection from the connection queue.
.. method:: socket.listen(backlog)
Start listening for incoming connections.
Note: Only one socket can be listening for connections at a time.
.. method:: socket.bind(addr)
Bind the socket to the address and port specified by the ``addr`` tuple.
.. method:: socket.send(buf)
Send the bytes from ``buf``.
.. method:: socket.recv()
Receive and return bytes from the socket.
UDP Methods
-----------
.. method:: socket.sendto(data, addr)
Placeholder for UDP support, not implemented yet.
.. method:: socket.recvfrom(addr)
Placeholder for UDP support, not implemented yet.
Callback Setter Methods
-----------------------
.. method:: onconnect(lambda)::
When connection is established, call the callback ``lambda``.
.. method:: onrecv(lambda)::
When data is received, call the callback ``lambda``.
.. method:: onsent(lamda)::
What data is finished sending, call the callback ``lambda``.
.. method:: ondisconnect(lambda)::
Call the callback ``lambda`` when the connection is closed.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment