Rev 2998 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2998 | Rev 3143 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;; Part of the tcp/ip network stack for KolibriOS ;; |
6 | ;; Part of the TCP/IP network stack for KolibriOS ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; Written by hidnplayr@kolibrios.org, ;; |
8 | ;; Written by hidnplayr@kolibrios.org, ;; |
9 | ;; and Clevermouse. ;; |
9 | ;; and Clevermouse. ;; |
10 | ;; ;; |
10 | ;; ;; |
11 | ;; Based on code by mike.dld ;; |
11 | ;; Based on code by mike.dld ;; |
Line 13... | Line 13... | ||
13 | ;; GNU GENERAL PUBLIC LICENSE ;; |
13 | ;; GNU GENERAL PUBLIC LICENSE ;; |
14 | ;; Version 2, June 1991 ;; |
14 | ;; Version 2, June 1991 ;; |
15 | ;; ;; |
15 | ;; ;; |
16 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
16 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 17... | Line 17... | ||
17 | 17 | ||
Line 18... | Line 18... | ||
18 | $Revision: 2998 $ |
18 | $Revision: 3143 $ |
Line 19... | Line 19... | ||
19 | 19 | ||
Line 236... | Line 236... | ||
236 | macro SOCKET_block socket, loop, done { |
236 | macro SOCKET_block socket, loop, done { |
Line 237... | Line 237... | ||
237 | 237 | ||
238 | test [socket + SOCKET.options], SO_BLOCK ; Is this a blocking socket? |
238 | test [socket + SOCKET.options], SO_BLOCK ; Is this a blocking socket? |
Line 239... | Line 239... | ||
239 | jz done ; No, return immediately |
239 | jz done ; No, return immediately |
- | 240 | ||
240 | 241 | pusha |
|
241 | push esi |
242 | mov eax, EVENT_NETWORK |
242 | mov esi, 5 ; yes, wait for event |
243 | mov ebx, 1337 ; UID: ???? |
Line 243... | Line 244... | ||
243 | call delay_ms |
244 | call wait_event |
Line 244... | Line 245... | ||
244 | pop esi |
245 | popa |
Line 1197... | Line 1198... | ||
1197 | jne .next_socket |
1198 | jne .next_socket |
Line 1198... | Line 1199... | ||
1198 | 1199 | ||
1199 | cmp [esi + UDP_SOCKET.LocalPort], bx |
1200 | cmp [esi + UDP_SOCKET.LocalPort], bx |
Line 1200... | Line 1201... | ||
1200 | jne .next_socket |
1201 | jne .next_socket |
1201 | 1202 | ||
Line 1202... | Line 1203... | ||
1202 | DEBUGF 1,"local port %u already in use\n", bx |
1203 | DEBUGF 1,"local port %x already in use\n", bx ; FIXME: find a way to print big endian values with debugf |
1203 | ret |
1204 | ret |
1204 | 1205 |