Q&A

  • 소켓에러 10048이 발생합니다.
소켓에러 10048이 발생합니다.

왜 발생하고 어떻게 처리해야 할지...
1  COMMENTS
  • Profile
    최도선 2006.02.17 17:31
    winsock API ErrCode에 보시면 WSAEADDRINUSE 라고 나와 있네요

    MSDN에서  발췌한 내용입니다.
    Address already in use.
    Typically, only one usage of each socket address (protocol/IP address/port) is permitted. This error occurs if an application attempts to bind a socket to an IP address/port that has already been used for an existing socket, or a socket that was not closed properly, or one that is still in the process of closing. For server applications that need to bind multiple sockets to the same port number, consider using setsockopt (SO_REUSEADDR). Client applications usually need not call bind at all— connect chooses an unused port automatically. When bind is called with a wildcard address (involving ADDR_ANY), a WSAEADDRINUSE error could be delayed until the specific address is committed. This could happen with a call to another function later, including connect, listen, WSAConnect, or WSAJoinLeaf.