Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, October 17, 2026

Diff for libplaton/platon/net/connection.h between version 1.12 and 1.13

version 1.12, 2003/07/16 16:09:16 version 1.13, 2006/08/14 10:03:21
Line 17 
Line 17 
  *   *
  * @file        platon/net/connection.h   * @file        platon/net/connection.h
  * @author      Ondrej Jombik <nepto@platon.sk>   * @author      Ondrej Jombik <nepto@platon.sk>
  * @version     \$Platon: libplaton/platon/net/connection.h,v 1.11 2003/04/23 19:28:36 nepto Exp $   * @version     \$Platon: libplaton/platon/net/connection.h,v 1.12 2003/07/16 16:09:16 nepto Exp $
  * @date        2000-2003   * @date        2000-2003
  */   */
   
 #ifndef _PLATON_NET_CONNECTION_H  #ifndef _PLATON_NET_CONNECTION_H
 #define _PLATON_NET_CONNECTION_H  #define _PLATON_NET_CONNECTION_H
   
 /** End of line string. */  
 #ifndef NET_CONNECTION_EOL  
 #  define NET_CONNECTION_EOL "\r\n"  
 #endif  
   
 /** Default port (telnet) */  
 #ifndef NET_CONNECTION_PORT  
 #  define NET_CONNECTION_PORT 23  
 #endif  
   
 /** Stream mode */  
 #ifndef NET_CONNECTION_FMODE  
 #  define NET_CONNECTION_FMODE "rt+"  
 #endif  
   
 /**  
  * Performs stream-oriented connection to remote host  
  *  
  * @param       host            hostname  
  * @param       port            port  
  * @return      connection stream (FILE *)  
  *  
  * Note that ouput stream will be buffered.  
  */  
 #define net_connection_fconnect(host,port) \  
 fdopen(net_connection_connect(host,port), NET_CONNECTION_FMODE)  
   
 #ifdef __cplusplus  #ifdef __cplusplus
 extern "C" {  extern "C" {
 #endif  #endif
Line 62  extern "C" {
Line 35  extern "C" {
          * @param       port            port           * @param       port            port
          * @return      connection handle (socket) or -1 on error           * @return      connection handle (socket) or -1 on error
          */           */
         int net_connection_connect(const char*host,int port);          int net_connection_open(const char *host, int port);
           void net_connection_close(int *handle);
   
         /**          /**
          * Read data from connection           * Read data from connection
Line 72  extern "C" {
Line 46  extern "C" {
          * @param       size    buffer size           * @param       size    buffer size
          * @return      count of read bytes or negative value on connection lost           * @return      count of read bytes or negative value on connection lost
          */           */
         int net_connection_read(int handle,char*buffer,int size);          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           * Read one line from connection
          *           *
Line 84  extern "C" {
Line 61  extern "C" {
          *           *
          * One line is character set terminated with @ref NET_CONNECTION_EOL.           * 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(int *handle, char *buffer, int size);
           int net_connection_gets_blocked(int *handle, char *buffer, int size);
   #endif
   
 #ifdef __cplusplus  #ifdef __cplusplus
 }  }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top