circuitpython/ports/espressif/common-hal/socketpool/Socket.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.8 KiB
C
Raw Normal View History

2020-08-11 19:04:55 -04:00
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#pragma once
2020-08-11 19:04:55 -04:00
#include "py/obj.h"
2020-08-12 19:57:39 -04:00
#include "common-hal/socketpool/SocketPool.h"
2020-08-13 19:55:49 -04:00
#include "common-hal/ssl/SSLContext.h"
2020-08-12 19:57:39 -04:00
2020-09-28 18:59:29 -04:00
#include "components/esp-tls/esp_tls.h"
2020-08-12 19:57:39 -04:00
typedef struct ssl_sslsocket_obj ssl_sslsocket_obj_t;
2020-08-11 19:04:55 -04:00
typedef struct {
mp_obj_base_t base;
2020-08-12 19:57:39 -04:00
int num;
2020-12-14 12:57:39 -05:00
int type;
int family;
int ipproto;
2020-08-18 20:06:59 -04:00
bool connected;
2021-03-15 09:57:36 -04:00
socketpool_socketpool_obj_t *pool;
ssl_sslsocket_obj_t *ssl_socket;
2020-08-12 19:57:39 -04:00
mp_uint_t timeout_ms;
2020-08-11 19:04:55 -04:00
} socketpool_socket_obj_t;
void socket_user_reset(void);
// Unblock workflow socket select thread (platform specific)
void socketpool_socket_poll_resume(void);