2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
11 #include "bsdsocket_intern.h"
12 #include "bsdsocket_util.h"
13 #include "socket_intern.h"
15 /*****************************************************************************
19 AROS_LH1(int, CloseSocket
,
25 struct TaskBase
*, taskBase
, 20, BSDSocket
)
45 *****************************************************************************/
51 D(bug("[bsdsocket] CloseSocket(%u)\n", s
));
53 sd
= IntCloseSocket(s
, taskBase
);
56 Remove((struct Node
*)sd
);
57 FreePooled(taskBase
->pool
, sd
, sizeof(struct Socket
));
59 taskBase
->dTable
[s
] = NULL
;
68 struct Socket
*IntCloseSocket(int s
, struct TaskBase
*taskBase
)
70 struct Socket
*sd
= GetSocket(s
, taskBase
);
74 struct bsdsocketBase
*SocketBase
= taskBase
->glob
;
78 err
= WSclosesocket(sd
->s
);
80 err
= WSAGetLastError() - WSABASEERR
;
82 D(bug("[CloseSocket] Closed socket %u, error %u\n", s
, err
));
86 SetError(err
, taskBase
);