📄 httcp.h
字号:
/* W3C Sample Code Library libwww Socket Open and Close! Socket Open and Close!*//*** (c) COPYRIGHT MIT 1995.** Please first read the full copyright statement in the file COPYRIGH.*//*The Socket Open and Close methods knows how to establish a BSD socket TCPconnection and is part of the Transport interface.This module is implemented by HTTCP.c, and it is apart of the W3C Sample CodeLibrary.*/#ifndef HTTCP_H#define HTTCP_H#include "HTReq.h"#include "HTNet.h"/*. Active Connection Establishment.This makes an active connect to the specified host. AnHTNet Object is parsed in order to handle errorsand other stuff. The default port might be overwritten by any port indicationin the URL specifiedas <host>:<port> If it is a multihomed host (ahost having multiple IP-addresses with the same host name) thenHTDoConnect() measures the time it takes to connect and updatesthe calculated weights in the DNS object.*/extern int HTDoConnect (HTNet * net);/*. Passive Connection Establishment.This function makes an accept on a port. The net must containa valid socket to accept on. If accept is OK then we duplicate thenet object and assign the accepted socket to the newly created net object.The original Net object will keep accepting connectionson the original socket, for example port 80 in the case ofHTTP. The newly created Net object will be freedwhen the protocol module has finished. If theaccepted net object pointer points to the net object itself, thatis - the same object all along - then we reuse the same Net obejct; closesthe original socket and replaces it wik the accepted one. This is a quickway of accepting a single connection.*/extern int HTDoAccept (HTNet * listen, HTNet * accept);/*. Listen on a Socket.Listens on the specified port described in the Netobject. backlog is the number of connections that can bequeued on the socket - you can use HT_BACKLOG for aplatform dependent value (typically 5 on BSD and 32 on SVR4). ReturnsHT_ERROR or HT_OK.*/extern int HTDoListen (HTNet * net, HTNet * accept, int backlog);/*. Closing a socket.Closes a socket*/extern int HTDoClose (HTNet * net);/**/#endif /* HTTCP_H *//* @(#) $Id: HTTCP.html,v 2.44 1999/07/07 15:43:28 frystyk Exp $*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -