Skip to content

Commit

Permalink
set timeout for recv
Browse files Browse the repository at this point in the history
  • Loading branch information
jedeoric committed May 5, 2024
1 parent 9dc3956 commit 5eb1833
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/recv.s
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
;;@inputY Low ptr to store the buffer
;;@inputX High ptr to store the buffer
;;@modifyMEM_RES
;;@returnsA Error type
;;@returnsA Error type. If A = EOK then something had been received
;;@returnsX Low length
;;@returnsY High length
sta save_socket_id
Expand Down Expand Up @@ -82,7 +82,11 @@
inx
cpx #255 ; Ne pas faire moins car l'interruption peut mettre du temps
bne @read_bytes_test
jmp @exit_get
; Timeout
lda #ETIMEDOUT
ldx #$00

rts

@read_buffer:
lda save_socket_id ; Set socket
Expand Down Expand Up @@ -140,17 +144,6 @@ save_x:
save_socket_id:
.res 1

.ifdef SOCKET_DEBUG
str_debug_socket_recv:
.asciiz "[libsocket/socket_recv.s] "

str_debug_socket_recv_waiting_buffer:
.asciiz "Waiting recv buffer ... "

str_debug_socket_recv_received_buffer:
.asciiz "Received recv buffer bytes : "
.endif

.endproc

CH395_GINT_STAT_SOCKX:
Expand Down

0 comments on commit 5eb1833

Please sign in to comment.