Subversion Repositories Kolibri OS

Rev

Rev 3674 | Rev 3704 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3674 Rev 3698
Line 192... Line 192...
192
SOCKET_QUEUE_SIZE       = 10       ; maximum number of incoming packets queued for 1 socket
192
SOCKET_QUEUE_SIZE       = 10       ; maximum number of incoming packets queued for 1 socket
193
; the incoming packet queue for sockets is placed in the socket struct itself, at this location from start
193
; the incoming packet queue for sockets is placed in the socket struct itself, at this location from start
194
SOCKET_QUEUE_LOCATION   = (SOCKETBUFFSIZE - SOCKET_QUEUE_SIZE*sizeof.socket_queue_entry - sizeof.queue)
194
SOCKET_QUEUE_LOCATION   = (SOCKETBUFFSIZE - SOCKET_QUEUE_SIZE*sizeof.socket_queue_entry - sizeof.queue)
Line 195... Line 195...
195
 
195
 
-
 
196
uglobal
-
 
197
align 4
196
uglobal
198
 
197
        net_sockets     rd 4
199
        net_sockets     rd 4
198
        last_socket_num dd ?
200
        last_socket_num dd ?
199
        last_UDP_port   dw ? ; These values give the number of the last used ephemeral port
201
        last_UDP_port   dw ? ; These values give the number of the last used ephemeral port
200
        last_TCP_port   dw ? ;
202
        last_TCP_port   dw ? ;
-
 
203
        socket_mutex    MUTEX
201
        socket_mutex    MUTEX
204
 
Line 202... Line 205...
202
endg
205
endg
203
 
206
 
Line 612... Line 615...
612
        ret
615
        ret
Line 613... Line 616...
613
 
616
 
614
  .loop:
617
  .loop:
615
        cmp     [eax + TCP_SOCKET.t_state], TCPS_CLOSED
618
        cmp     [eax + TCP_SOCKET.t_state], TCPS_CLOSED
616
        je      .fail
619
        je      .fail
617
        cmp     [eax + TCP_SOCKET.t_state], TCPS_SYN_SENT
620
        cmp     [eax + TCP_SOCKET.t_state], TCPS_ESTABLISHED
-
 
621
        je      .established
Line 618... Line 622...
618
        jne     .syn_received
622
        ja      .fail
619
 
623
 
Line 620... Line 624...
620
        call    SOCKET_block
624
        call    SOCKET_block
621
        jmp     .loop
625
        jmp     .loop
622
 
626
 
623
  .fail:
627
  .fail:
624
        mov     eax, [eax + SOCKET.errorcode]
628
        mov     eax, [eax + SOCKET.errorcode]
Line 625... Line 629...
625
        mov     [esp+20], eax
629
        mov     [esp+20], eax
626
        mov     dword[esp+32], -1
630
        mov     dword[esp+32], -1
627
        ret
631
        ret
Line 628... Line 632...
628
 
632