File: [Platon] / libplaton / platon / net / connection.h (download)
Revision 1.13, Mon Aug 14 10:03:21 2006 UTC (17 years, 8 months ago) by nepto
Changes since 1.12: +10 -31 lines
Very old, forgotten, most likely not working, but seems to do something
|
/**************************************************************************
* *
* Net TCP/IP connection routines *
* *
* Programmed by Ondrej Jombik <nepto@platon.sk> *
* Copyright (c) 2000 Condy software inc. *
* Copyright (c) 2001-2003 Platon Software Development Group *
* All rights reserved. *
* *
* Updates: 29.1.2000, 9.2.2000, 21.3.2000, 5.10.2001 *
* 20.9.2002 - Doxygen documentation *
* *
**************************************************************************/
/**
* Net TCP/IP connection routines
*
* @file platon/net/connection.h
* @author Ondrej Jombik <nepto@platon.sk>
* @version \$Platon: libplaton/platon/net/connection.h,v 1.12 2003/07/16 16:09:16 nepto Exp $
* @date 2000-2003
*/
#ifndef _PLATON_NET_CONNECTION_H
#define _PLATON_NET_CONNECTION_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* Connects to remote host
*
* @param host hostname
* @param port port
* @return connection handle (socket) or -1 on error
*/
int net_connection_open(const char *host, int port);
void net_connection_close(int *handle);
/**
* Read data from connection
*
* @param handle connection handle (socket)
* @retval buffer pointer where to store read data
* @param size buffer size
* @return count of read bytes or negative value on connection lost
*/
int net_connection_read(int *handle, void *buffer, int size);
int net_connection_read_blocked(int *handle, void *buffer, int size);
int net_connection_read_full(int *handle, void *buffer, int size);
#if 0
/**
* Read one line from connection
*
* @param handle connection handle (socket)
* @retval buffer pointer where to store read data
* @param size buffer size
* @return count of read bytes or negative value on connection lost
*
* One line is character set terminated with @ref NET_CONNECTION_EOL.
*/
int net_connection_gets(int *handle, char *buffer, int size);
int net_connection_gets_blocked(int *handle, char *buffer, int size);
#endif
#ifdef __cplusplus
}
#endif
#endif /* #ifndef _PLATON_NET_CONNECTION_H */
Platon Group <platon@platon.org> http://platon.org/
|