Problem with VACPP 3.0 and sockets - OS2

This is a discussion on Problem with VACPP 3.0 and sockets - OS2 ; I'm trying to build a program with VACPP 3.0 (fp 8) and TK4.5. When connecting to a socket, I get an error "The address family is not supported". if ((hp = gethostbyname(host)) == NULL) { sprintf(text,"Invalid or unknown host '%s'",host); ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Problem with VACPP 3.0 and sockets

  1. Problem with VACPP 3.0 and sockets

    I'm trying to build a program with VACPP 3.0 (fp 8) and TK4.5.

    When connecting to a socket, I get an error "The address family is not
    supported".


    if ((hp = gethostbyname(host)) == NULL) {
    sprintf(text,"Invalid or unknown host '%s'",host);
    ret_code = FALSE;
    } else {
    memcpy(&sin.sin_addr,hp->h_addr,hp->h_length);
    port = htons(portnum);
    }
    }


    if (ret_code) {
    sin.sin_family = AF_INET;
    sin.sin_port = port;

    if ((s = socket(AF_INET,SOCK_STREAM,0)) < 0) {
    ErrorText(sock_errno(),text);
    ret_code = FALSE;
    }
    }

    if (ret_code) {
    if (connect(s,(struct sockaddr *)&sin,sizeof(sin)) < 0) {


    Any clues?

    Thanks.



  2. Re: Problem with VACPP 3.0 and sockets

    On Mon, 16 Jul 2007 05:33:12 UTC Bill Silverstein
    wrote:

    Rather incomplete information,

    > I'm trying to build a program with VACPP 3.0 (fp 8) and TK4.5.
    >
    > When connecting to a socket, I get an error "The address family is not
    > supported".
    >
    >
    > if ((hp = gethostbyname(host)) == NULL) {
    > sprintf(text,"Invalid or unknown host '%s'",host);
    > ret_code = FALSE;
    > } else {
    > memcpy(&sin.sin_addr,hp->h_addr,hp->h_length);
    > port = htons(portnum);
    > }
    > }
    >
    >
    > if (ret_code) {
    > sin.sin_family = AF_INET;
    > sin.sin_port = port;
    >
    > if ((s = socket(AF_INET,SOCK_STREAM,0)) < 0) {


    do your really want IPPROTO_IP? Specfify IPPROTO_TCP as third parm.


    CU/2
    --
    Frank Beythien fBeythien AT gmx.de

  3. Re: Problem with VACPP 3.0 and sockets

    In , on 07/15/2007
    at 11:33 PM, Bill Silverstein said:

    Hi,

    >I'm trying to build a program with VACPP 3.0 (fp 8) and TK4.5.


    >When connecting to a socket, I get an error "The address family is not
    >supported".


    This does not look quite right.

    You appear to be missing a sock_init() call.


    Steven

    --
    --------------------------------------------------------------------------------------------
    Steven Levine MR2/ICE 3.00 beta 07pre #10183
    eCS/Warp/DIY/14.103a_W4 www.scoug.com irc.ca.webbnet.info #scoug (Wed 7pm PST)
    --------------------------------------------------------------------------------------------


  4. Re: Problem with VACPP 3.0 and sockets

    On Tue, 17 Jul 2007 07:17:17 GMT, Steven Levine wrote:

    >In , on 07/15/2007
    > at 11:33 PM, Bill Silverstein said:
    >
    >Hi,
    >
    >>I'm trying to build a program with VACPP 3.0 (fp 8) and TK4.5.

    >
    >>When connecting to a socket, I get an error "The address family is not
    >>supported".

    >
    >This does not look quite right.
    >
    >You appear to be missing a sock_init() call.
    >
    >
    >Steven
    >
    >--


    Nah, the call was prior to the posted code. I found the problem. The PRM
    code was done with CSet and the old version of TCPIP. I fixed the
    library that it linked with and changed the select calls to os2_select
    and made it happy.




+ Reply to Thread