⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 connpool.h

📁 mini http server,可以集成嵌入到程序中,实现简单的web功能
💻 H
字号:
/*____________________________________________________________________________*\
 *

 Copyright (c) 1997-2003 John Roy, Holger Zimmermann. All rights reserved.

 These sources, libraries and applications are
 FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
 as long as the following conditions are adhered to.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:

 1. Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer. 

 2. Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in
    the documentation and/or other materials provided with the
    distribution.

 3. The name of the author may not be used to endorse or promote products
    derived from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 IN NO EVENT SHALL THE AUTHORS OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 OF THE POSSIBILITY OF SUCH DAMAGE.

 *____________________________________________________________________________*|
 *
 * $Source: /cvsroot/pi3web/Pi3Web_200/Source/Pi3API/ConnPool.h,v $
 * $Date: 2003/05/13 18:42:09 $
 *
 Description:

\*____________________________________________________________________________*/
/* $SourceTop:$ */

#ifndef CONNPOOL_H_
#define CONNPOOL_H_

#include "Pi2API.h"
#include "PIIOBuf.h"

typedef struct _ConnectionPool ConnectionPool;

/*____________________________________________________________________________*\
 *
 Name:
	ConnectionPool_new

 Synopsis:
	ConnectionPool *ConnectionPool_new( PIObject *pIOObject, int iMaxSize )

 Description:
	Create an instance of a ConnectionPool object from the given IOObject
	A ConnectionPool object could be used e.g. in a TCP or HTTP client library.

 Notes:
	The parameter iMaxSize is ignored in the current implementation.

 Return Values:
	Returns a pointer to the new ConnectionPool object, or NULL if an error
	occurred.

 Errors:
 See Also:
	ConnectionPool_delete
\*____________________________________________________________________________*/
PUBLIC_PIAPI ConnectionPool *ConnectionPool_new( PIObject *pIOObject, 
    int iMaxSize );

/*____________________________________________________________________________*\
 *
 Name:
	ConnectionPool_delete

 Synopsis:
	int ConnectionPool_delete( ConnectionPool *pConnectionPool )

 Description:
	Deletes an instance of a ConnectionPool object.

 Notes:
 Return Values:
	PIAPI_COMPLETED on success or PIAPI_EINVAL, if wrong pConnectionPool given.

 Errors:
	PIAPI_EINVAL

 See Also:
	ConnectionPool_new
\*____________________________________________________________________________*/
PUBLIC_PIAPI int ConnectionPool_delete( ConnectionPool *pConnectionPool );

/*____________________________________________________________________________*\
 *
 Name:
	ConnectionPool_grapConnection

 Synopsis:
	PIIOBuffer *ConnectionPool_grapConnection( ConnectionPool *pConnectionPool,
        const char *pHost, int iPort )

 Description:
	This function will establish a connection to the remote server using the
	given parameters.

 Notes:
 Return Values:
	Returns a pointer to the new PIIOBuffer object, or NULL if an error occurred.

 Errors:
 See Also:
	ConnectionPool_releaseConnection
\*____________________________________________________________________________*/
PUBLIC_PIAPI PIIOBuffer *ConnectionPool_grapConnection(
    ConnectionPool *pConnectionPool, const char *pHost, int iPort );

/*____________________________________________________________________________*\
 *
 Name:
	ConnectionPool_releaseConnection

 Synopsis:
	int ConnectionPool_releaseConnection( ConnectionPool *pConnectionPool,
        PIIOBuffer *pConnection, bool bMustClose )

 Description:
	This function will release a connection to the remote server using the
	given parameters.

 Notes:
	The parameter bMustClose is ignored by the current implementation.

 Return Values:
	PIAPI_COMPLETED on success or PIAPI_ERROR, PIAPI_EINVAL

 Errors:
	PIAPI_EINVAL, if wrong pConnectionPool given, PIAPI_ERROR for all other
	error cases.

 See Also:
	ConnectionPool_grapConnection
\*____________________________________________________________________________*/
PUBLIC_PIAPI int ConnectionPool_releaseConnection(
    ConnectionPool *pConnectionPool, PIIOBuffer *pConnection, bool bMustClose );

#endif /* CONNPOOL_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -