Go to the documentation of this file.00001 #ifndef HEADER_CURL_CONNECT_H
00002 #define HEADER_CURL_CONNECT_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "curl_setup.h"
00025
00026 #include "nonblock.h"
00027 #include "sockaddr.h"
00028
00029 CURLcode Curl_is_connected(struct connectdata *conn,
00030 int sockindex,
00031 bool *connected);
00032
00033 CURLcode Curl_connecthost(struct connectdata *conn,
00034 const struct Curl_dns_entry *host);
00035
00036
00037
00038 time_t Curl_timeleft(struct Curl_easy *data,
00039 struct timeval *nowp,
00040 bool duringconnect);
00041
00042 #define DEFAULT_CONNECT_TIMEOUT 300000
00043 #define HAPPY_EYEBALLS_TIMEOUT 200
00044
00045
00046
00047
00048
00049
00050
00051
00052 curl_socket_t Curl_getconnectinfo(struct Curl_easy *data,
00053 struct connectdata **connp);
00054
00055
00056
00057
00058 bool Curl_connalive(struct connectdata *conn);
00059
00060 #ifdef USE_WINSOCK
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 void Curl_sndbufset(curl_socket_t sockfd);
00071 #else
00072 #define Curl_sndbufset(y) Curl_nop_stmt
00073 #endif
00074
00075 void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd);
00076 void Curl_persistconninfo(struct connectdata *conn);
00077 int Curl_closesocket(struct connectdata *conn, curl_socket_t sock);
00078
00079
00080
00081
00082
00083
00084
00085
00086 struct Curl_sockaddr_ex {
00087 int family;
00088 int socktype;
00089 int protocol;
00090 unsigned int addrlen;
00091 union {
00092 struct sockaddr addr;
00093 struct Curl_sockaddr_storage buff;
00094 } _sa_ex_u;
00095 };
00096 #define sa_addr _sa_ex_u.addr
00097
00098
00099
00100
00101
00102
00103
00104
00105 CURLcode Curl_socket(struct connectdata *conn,
00106 const Curl_addrinfo *ai,
00107 struct Curl_sockaddr_ex *addr,
00108 curl_socket_t *sockfd);
00109
00110 void Curl_tcpnodelay(struct connectdata *conn, curl_socket_t sockfd);
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124 #define CONNCTRL_KEEP 0
00125 #define CONNCTRL_CONNECTION 1
00126 #define CONNCTRL_STREAM 2
00127
00128 void Curl_conncontrol(struct connectdata *conn,
00129 int closeit
00130 #ifdef DEBUGBUILD
00131 , const char *reason
00132 #endif
00133 );
00134
00135 #ifdef DEBUGBUILD
00136 #define streamclose(x,y) Curl_conncontrol(x, CONNCTRL_STREAM, y)
00137 #define connclose(x,y) Curl_conncontrol(x, CONNCTRL_CONNECTION, y)
00138 #define connkeep(x,y) Curl_conncontrol(x, CONNCTRL_KEEP, y)
00139 #else
00140 #define streamclose(x,y) Curl_conncontrol(x, CONNCTRL_STREAM)
00141 #define connclose(x,y) Curl_conncontrol(x, CONNCTRL_CONNECTION)
00142 #define connkeep(x,y) Curl_conncontrol(x, CONNCTRL_KEEP)
00143 #endif
00144
00145 bool Curl_conn_data_pending(struct connectdata *conn, int sockindex);
00146
00147 #endif