cURL / Mailing Lists / curl-library / Single Mail

curl-library

Mapping Linux socket API's to libcurl API's

From: swati mishra <swati_damsel_at_yahoo.co.in>
Date: Wed, 14 Sep 2011 13:13:06 +0530 (IST)

Hi, I am new to libcurl.
I need to know how I can map linux socket API's to libcurl API's
For eaxmple in below API's what would beequivalent of socket/connect/send/recv API's?
Any help in this regard is greatly appreciated.
1.)Create(Callback_s *callback) { s = socket( PF_INET, SOCK_STREAM, 0)
}
2.) Connect( void *h, Scheme_e scheme/*HTTP or HTTPS*/, const char *addr, unsigned short PortNum, unsigned long TimeOut) { struct sockaddr_in sin; SOCKET s;
connect( s, (struct sockaddr*)&sin, sizeof(sin)) == SOCKET_ERROR)}
3.) Send( void *h, char *SendBuf, unsigned long SendLen, unsigned long timeOut) {
SSL_write(ssl, SendBuf, SendLen ) OR send(socket, SendBuf, SendLen, 0); }
4.) Recv( void *h, char* RecvBuf, unsigned long *RecvLen, unsigned long timeout) { SSL_read(ssl, RecvBuf, TargetSize ) OR recv(socket, RecvBuf, TargetSize, 0);}
rgds,Swati

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-14