Subversion Repositories Kolibri OS

Rev

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

Rev 3981 Rev 4143
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                                 ;;
2
;;                                                                 ;;
3
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved.    ;;
3
;; Copyright (C) KolibriOS team 2004-2013. 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
;;   Written by hidnplayr@kolibrios.org                            ;;
6
;;                                                                 ;;
7
;;                                                                 ;;
7
;;         GNU GENERAL PUBLIC LICENSE                              ;;
8
;;         GNU GENERAL PUBLIC LICENSE                              ;;
8
;;          Version 2, June 1991                                   ;;
9
;;          Version 2, June 1991                                   ;;
9
;;                                                                 ;;
10
;;                                                                 ;;
10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 11... Line 12...
11
 
12
 
Line 12... Line -...
12
 
-
 
13
socket_connect:
-
 
14
 
-
 
15
;        cmp     [status], STATUS_CONNECTED     ; TODO
13
 
16
;        je      disconnect
14
socket_connect:
17
 
15
 
Line -... Line 16...
-
 
16
; ignore if status is not "disconnected"
-
 
17
        cmp     [status], STATUS_DISCONNECTED
-
 
18
        jne     .reconnect
18
; ignore if status is not "disconnected"
19
 
19
        cmp     [status], STATUS_DISCONNECTED
20
        if TIMESTAMP
20
        jne     .nothing
21
        call    print_timestamp
21
 
22
        end if
22
        mov     esi, str_connecting
23
        mov     esi, str_connecting
Line 61... Line 62...
61
 
62
 
62
        mcall   connect, [socketnum], sockaddr1, 18
63
        mcall   connect, [socketnum], sockaddr1, 18
63
        cmp     eax, -1
64
        cmp     eax, -1
Line 64... Line -...
64
        jz      .fail_refused
-
 
65
 
65
        jz      .fail_refused
Line 66... Line 66...
66
  .nothing:
66
 
67
        ret
67
        ret
Line -... Line 68...
-
 
68
 
-
 
69
  .fail:
-
 
70
        mov     [status], STATUS_DISCONNECTED
68
 
71
 
69
  .fail:
72
        if TIMESTAMP
Line 70... Line 73...
70
        mov     [status], STATUS_DISCONNECTED
73
        call    print_timestamp
Line 71... Line 74...
71
 
74
        end if
72
        mov     esi, str_sockerr
75
        mov     esi, str_sockerr
Line -... Line 76...
-
 
76
        call    print_text2
-
 
77
 
-
 
78
        ret
73
        call    print_text2
79
 
74
 
80
  .fail_dns:
Line 75... Line 81...
75
        ret
81
        mov     [status], STATUS_DISCONNECTED
Line 76... Line 82...
76
 
82
 
77
  .fail_dns:
83
        if TIMESTAMP
Line -... Line 84...
-
 
84
        call    print_timestamp
-
 
85
        end if
-
 
86
        mov     esi, str_dnserr
78
        mov     [status], STATUS_DISCONNECTED
87
        call    print_text2
79
 
88
 
Line 80... Line 89...
80
        mov     esi, str_dnserr
89
        ret
Line -... Line 90...
-
 
90
 
-
 
91
  .fail_refused:
-
 
92
        mov     [status], STATUS_DISCONNECTED
-
 
93
 
-
 
94
        if TIMESTAMP
-
 
95
        call    print_timestamp
-
 
96
        end if
-
 
97
        mov     esi, str_refused
-
 
98
        call    print_text2
-
 
99
 
-
 
100
        ret
-
 
101
 
Line 81... Line 102...
81
        call    print_text2
102
  .reconnect:
Line 82... Line 103...
82
 
103
 
Line 178... Line 199...
178
 
199
 
179
; The connection has been established, change status from "connecting" to "connected".
200
; The connection has been established, change status from "connecting" to "connected".
Line 180... Line 201...
180
        inc     [status]
201
        inc     [status]
181
 
202
 
182
  .connected:
203
  .connected:
Line 183... Line 204...
183
        call    read_incoming_data
204
        call    socket_receive
184
        ret
-
 
185
 
-
 
186
 
-
 
187
disconnect:
-
 
188
 
-
 
189
        cmp     [status], STATUS_DISCONNECTED
-
 
190
        je      .nothing
-
 
191
 
-
 
192
        mcall   close, [socketnum]
-
 
193
 
-
 
194
        mov     [status], STATUS_DISCONNECTED
-
 
195
 
-
 
196
  .nothing:
-
 
197
        ret
-
 
Line 198... Line 205...
198
 
205
        ret
Line 199... Line 206...
199
 
206