MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / sal_connect

Function sal_connect

components/net/sal/src/sal_socket.c:887–915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885}
886
887int sal_connect(int socket, const struct sockaddr *name, socklen_t namelen)
888{
889 struct sal_socket *sock;
890 struct sal_proto_family *pf;
891 int ret;
892
893 /* get the socket object by socket descriptor */
894 SAL_SOCKET_OBJ_GET(sock, socket);
895
896 /* check the network interface is up status */
897 SAL_NETDEV_IS_UP(sock->netdev);
898 /* check the network interface socket opreation */
899 SAL_NETDEV_SOCKETOPS_VALID(sock->netdev, pf, connect);
900
901 ret = pf->skt_ops->connect((int)(size_t)sock->user_data, name, namelen);
902#ifdef SAL_USING_TLS
903 if (ret >= 0 && SAL_SOCKOPS_PROTO_TLS_VALID(sock, connect))
904 {
905 if (proto_tls->ops->connect(sock->user_data_tls) < 0)
906 {
907 return -1;
908 }
909
910 return ret;
911 }
912#endif
913
914 return ret;
915}
916
917int sal_listen(int socket, int backlog)
918{

Callers 4

connectFunction · 0.85
client_thread_entryFunction · 0.85
TC_sal_socket_connectFunction · 0.85
TC_sal_socket_send_recvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected