Hello everyone,

I'm currently writing a client application that shall communicate with a server 
using the EADK socket library. Now, if I run that program under linux, 
everything works flawlessly. However, under UEFI, I get an error when calling 
the connect() method of the socket - more specifically, the error 49 
(EADDRNOTAVAIL). I copied the necessary files from StdLib to the EFI stick as 
described in the readme.txt, however I didn't edit them as I don't need DNS 
resolution. The network interface is configured and I am able to e.g. ping the 
server. Does anyone have an idea what do do? 

The corresponding piece of code is this:

int CEndpoint_Connect(CEndpoint* const CEndpointObj, const char* pAddress) {
        int nRetry;
        struct sockaddr_in addr;

    if (strcmp(pAddress, BROADCAST) == 0)
        return TRUE;

    nRetry = MAX_RETRY;

    memset((char *) &addr,0, sizeof(addr));
    addr.sin_family = AF_INET;
    addr.sin_port = htons(g_port);
    addr.sin_addr.s_addr = inet_addr((char *) pAddress);

    while (connect(CEndpointObj->m_nSocket, (struct sockaddr *) &addr, 
sizeof(addr)) < 0) //Error happens here
    {
        printf("Verbindung mit Server fehlgeschlagen: errno = %d\n", errno);
        if (--nRetry == 0)
            return FALSE;
        sleep(SLEEP_TIME);
    }

    CEndpointObj->m_bBroadcast = FALSE;
    return TRUE;
}


With best regards,
Johannes Conen

Siemens AG
Process Industries and Drives Division
Process Automation
Manufacturing Karlsruhe
PD PA MF-K IPC 2
Oestliche Rheinbrueckenstr. 50
76187 Karlsruhe, Germany 
mailto:[email protected]

Siemens Aktiengesellschaft: Chairman of the Supervisory Board: Gerhard Cromme; 
Managing Board: Joe Kaeser, Chairman, President and Chief Executive Officer; 
Roland Busch, Lisa Davis, Klaus Helmrich, Janina Kugel, Siegfried Russwurm, 
Ralf P. Thomas; Registered offices: Berlin and Munich, Germany; Commercial 
registries: Berlin Charlottenburg, HRB 12300, Munich, HRB 6684; WEEE-Reg.-No. 
DE 23691322

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to