Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#28 Unsigned Int in Accept Function

closed-rejected
Yunhong Gu
5
2004-07-02
2004-06-04
No

While replacing UDT calls with TCP calls I got this
compile error.

server.cpp: In function `int main(int, char **)':
server.cpp:60: passing `int *' as argument 3 of
`accept(int, sockaddr *, socklen_t *)' changes signedness

//int namelen; (UDT Way)
unsigned int namelen; // (TCP Way)
.....
recver = CUDT::accept(serv, (sockaddr*)&their_addr,
&namelen);

This change solved the problem.

In UDT namelen is a regular int.
In TCP namelen is an unsigned int.

Pehaps we should change the UDT accept function to use
an unsigned int. Then we will better conform to the
TCP API.

Discussion

    • labels: 639452 --> Compile Time Errors
     
  • david hanley
    david hanley
    2004-06-04

    • assigned_to: nobody --> lilyco
     
  • Yunhong Gu
    Yunhong Gu
    2004-07-02

    Logged In: YES
    user_id=275995

    Linux uses socklen_t, which is subject to change to other
    types in future. BSD and Windows just use "int".

     
  • Yunhong Gu
    Yunhong Gu
    2004-07-02

    • status: open --> closed-rejected