| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

connect_UDP_fast

#include "sflsock.h"
sock_t
connect_UDP_fast (
    const struct sockaddr_in *sin       /*  Socket address structure         */
)

Synopsis

Creates a UDP socket and connects it to a specified host/port address. Returns a socket number or INVALID_SOCKET. In that case you can get the reason for the error by calling connect error (). This may be:
IP NOSOCKETS Sockets not supported on this system
IP BADHOST Host is not known
IP BADPROTOCOL Cannot understand protocol name
IP SOCKETERROR Cannot open a socket
IP CONNECTERROR Cannot connect socket
This function is faster, if you know the host system address and port, than connect UDP() because no translation is needed. You can get the host/address structure by calling address end point() or get peer addr(). See connect socket() for details.

Source Code - (sflsock.c)

{
    ASSERT (sin);
    return (connect socket (NULL,       /*  No host name                     */
                            NULL,       /*  No service name                  */
                            "udp",      /*  Protocol is UDP                  */
                            sin,        /*  We have a prepared address       */
                            1, 0));     /*  1 retry, no waiting              */
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation