Microchip® Advanced Software Framework

netconn Struct Reference

A netconn descriptor.

#include <api.h>

Data Fields

sys_mbox_t acceptmbox
 mbox where new connections are stored until processed by the application thread More...
 
netconn_callback callback
 A callback function that is informed about events for this netconn. More...
 
struct api_msg_msgcurrent_msg
 TCP: when data passed to netconn_write doesn't fit into the send buffer, this temporarily stores the message. More...
 
u8_t flags
 flags holding more netconn-internal state, see NETCONN_FLAG_* defines More...
 
err_t last_err
 the last error this netconn had More...
 
sys_sem_t op_completed
 sem that is used to synchronously execute functions in the core context More...
 
union {
   struct ip_pcb *   ip
 
   struct raw_pcb *   raw
 
   struct tcp_pcb *   tcp
 
   struct udp_pcb *   udp
 
pcb
 the lwIP internal protocol control block More...
 
int recv_timeout
 timeout in milliseconds to wait for new data to be received (or connections to arrive for listening netconns) More...
 
sys_mbox_t recvmbox
 mbox where received packets are stored until they are fetched by the netconn application thread (can grow quite big) More...
 
int socket
 only used for socket layer More...
 
enum netconn_state state
 current state of the netconn More...
 
enum netconn_type type
 type of the netconn (TCP, UDP or RAW) More...
 
size_t write_offset
 TCP: when data passed to netconn_write doesn't fit into the send buffer, this temporarily stores how much is already sent. More...
 

sys_mbox_t netconn::acceptmbox

mbox where new connections are stored until processed by the application thread

Referenced by accept_function(), err_tcp(), lwip_netconn_do_listen(), netconn_accept(), netconn_alloc(), netconn_drain(), netconn_free(), and netconn_new_with_proto_and_callback().

netconn_callback netconn::callback

A callback function that is informed about events for this netconn.

Referenced by accept_function(), lwip_accept(), and netconn_alloc().

struct api_msg_msg* netconn::current_msg

TCP: when data passed to netconn_write doesn't fit into the send buffer, this temporarily stores the message.

Also used during connect and close.

Referenced by err_tcp(), lwip_netconn_do_close(), lwip_netconn_do_close_internal(), lwip_netconn_do_connect(), lwip_netconn_do_connected(), lwip_netconn_do_delconn(), lwip_netconn_do_write(), lwip_netconn_do_writemore(), and netconn_alloc().

u8_t netconn::flags

flags holding more netconn-internal state, see NETCONN_FLAG_* defines

Referenced by lwip_getsockopt_impl(), lwip_netconn_do_listen(), lwip_netconn_do_write(), lwip_netconn_do_writemore(), lwip_setsockopt_impl(), netconn_alloc(), poll_tcp(), and sent_tcp().

sys_sem_t netconn::op_completed

sem that is used to synchronously execute functions in the core context

Referenced by lwip_getsockopt(), lwip_setsockopt(), netconn_alloc(), netconn_free(), and netconn_new_with_proto_and_callback().

int netconn::recv_timeout

timeout in milliseconds to wait for new data to be received (or connections to arrive for listening netconns)

Referenced by netconn_accept(), netconn_alloc(), and netconn_recv_data().

sys_mbox_t netconn::recvmbox

mbox where received packets are stored until they are fetched by the netconn application thread (can grow quite big)

Referenced by accept_function(), err_tcp(), lwip_netconn_do_listen(), netconn_alloc(), netconn_drain(), netconn_free(), netconn_new_with_proto_and_callback(), netconn_recv(), netconn_recv_data(), recv_raw(), recv_tcp(), and recv_udp().

int netconn::socket

only used for socket layer

Referenced by event_callback(), lwip_accept(), lwip_socket(), and netconn_alloc().

size_t netconn::write_offset

TCP: when data passed to netconn_write doesn't fit into the send buffer, this temporarily stores how much is already sent.

Referenced by lwip_netconn_do_close(), lwip_netconn_do_delconn(), lwip_netconn_do_write(), lwip_netconn_do_writemore(), and netconn_alloc().