src/tcp.h
branchnew-lib-errors
changeset 219 cefec18b8268
parent 218 5229a5d098b2
equal deleted inserted replaced
218:5229a5d098b2 219:cefec18b8268
     1 #ifndef TCP_H
       
     2 #define TCP_H
       
     3 
       
     4 /**
       
     5  * @file
       
     6  *
       
     7  * TCP transport/service implementation.
       
     8  *
       
     9  * XXX: provide some TCP-specific type/functions?
       
    10  */
       
    11 #include "transport.h"
       
    12 #include "service.h"
       
    13 
       
    14 /**
       
    15  * Connect the given transport via TCP to the given host/service. The transport will not be ready for use until the
       
    16  * transport_callbacks::on_connect callback has been invoked.
       
    17  *
       
    18  * XXX: blocking DNS resolution
       
    19  *
       
    20  * @param info the transport setup info
       
    21  * @param transport_ptr returned transport
       
    22  * @param host the hostname to connect to
       
    23  * @param service the service name (i.e. port) to connect to
       
    24  * @param err returned error info
       
    25  */
       
    26 err_t tcp_connect (const struct transport_info *info, transport_t **transport_ptr, 
       
    27         const char *host, const char *service, error_t *err);
       
    28 
       
    29 /**
       
    30  * Create a passive/listening TCP socket on the given interface/port (NULL to pick automatically).
       
    31  */
       
    32 err_t tcp_listen (const struct service_info *info, service_t **service_ptr, 
       
    33         const char *interface, const char *service, error_t *err);
       
    34 
       
    35 #endif