mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-09-08 21:54:28 +00:00
telnet sessions nows send a 'keepalive' (empty tcp packet) every 8 seconds or so, since my broadband router seems to timeout NAT entries after 10 seconds of inactivity (!)
git-svn-id: http://svn.code.sf.net/p/netboot65/code@225 93682198-c243-4bdb-bd91-e943c89aac3b
This commit is contained in:
parent
28de61b6e0
commit
0fdf2be2b8
@ -26,6 +26,7 @@ MAX_TCP_PACKETS_SENT=8 ;timeout after sending 8 messages will be about 7 sec
|
|||||||
.export tcp_send_string
|
.export tcp_send_string
|
||||||
.export tcp_close
|
.export tcp_close
|
||||||
.export tcp_listen
|
.export tcp_listen
|
||||||
|
.export tcp_send_keep_alive
|
||||||
|
|
||||||
.export tcp_inbound_data_ptr
|
.export tcp_inbound_data_ptr
|
||||||
.export tcp_inbound_data_length
|
.export tcp_inbound_data_length
|
||||||
@ -1013,7 +1014,9 @@ tcp_process:
|
|||||||
|
|
||||||
@not_syn:
|
@not_syn:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@send_ack:
|
@send_ack:
|
||||||
|
|
||||||
;create an ACK packet
|
;create an ACK packet
|
||||||
lda #tcp_flag_ACK
|
lda #tcp_flag_ACK
|
||||||
|
|
||||||
@ -1041,6 +1044,12 @@ tcp_process:
|
|||||||
jmp tcp_send_packet
|
jmp tcp_send_packet
|
||||||
|
|
||||||
|
|
||||||
|
;send an empty ACK packet on the current connection
|
||||||
|
;inputs:
|
||||||
|
; none
|
||||||
|
;outputs:
|
||||||
|
; carry flag is set if an error occured, clear otherwise
|
||||||
|
tcp_send_keep_alive=@send_ack
|
||||||
|
|
||||||
;-- LICENSE FOR tcp.s --
|
;-- LICENSE FOR tcp.s --
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
; The contents of this file are subject to the Mozilla Public License
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
.import vt100_init_terminal
|
.import vt100_init_terminal
|
||||||
.import vt100_process_inbound_char
|
.import vt100_process_inbound_char
|
||||||
.import vt100_transform_outbound_char
|
.import vt100_transform_outbound_char
|
||||||
|
.import tcp_send_keep_alive
|
||||||
|
.import timer_read
|
||||||
|
|
||||||
.import ip65_process
|
.import ip65_process
|
||||||
.import get_key_if_available
|
.import get_key_if_available
|
||||||
@ -136,8 +137,19 @@ telnet_connect:
|
|||||||
jmp @send_char
|
jmp @send_char
|
||||||
|
|
||||||
@not_line_mode:
|
@not_line_mode:
|
||||||
|
|
||||||
|
@inner_loop:
|
||||||
|
jsr timer_read
|
||||||
|
txa
|
||||||
|
adc #$20 ;32 x 1/4 = ~ 8seconds
|
||||||
|
sta telnet_timeout
|
||||||
@wait_for_keypress:
|
@wait_for_keypress:
|
||||||
|
jsr timer_read
|
||||||
|
cpx telnet_timeout
|
||||||
|
bne @no_timeout
|
||||||
|
jsr tcp_send_keep_alive
|
||||||
|
jmp @inner_loop
|
||||||
|
@no_timeout:
|
||||||
jsr ip65_process
|
jsr ip65_process
|
||||||
lda iac_response_buffer_length
|
lda iac_response_buffer_length
|
||||||
beq @no_iac_response
|
beq @no_iac_response
|
||||||
@ -156,7 +168,7 @@ telnet_connect:
|
|||||||
cmp #KEYCODE_F1
|
cmp #KEYCODE_F1
|
||||||
bne @not_telnet_menu
|
bne @not_telnet_menu
|
||||||
jsr telnet_menu
|
jsr telnet_menu
|
||||||
jmp @wait_for_keypress
|
jmp @inner_loop
|
||||||
@not_telnet_menu:
|
@not_telnet_menu:
|
||||||
tax
|
tax
|
||||||
|
|
||||||
@ -503,7 +515,7 @@ naws_response_length=*-naws_response
|
|||||||
.segment "APP_SCRATCH"
|
.segment "APP_SCRATCH"
|
||||||
telnet_ip: .res 4 ;ip address of remote server
|
telnet_ip: .res 4 ;ip address of remote server
|
||||||
telnet_port: .res 2 ;port number to connect to
|
telnet_port: .res 2 ;port number to connect to
|
||||||
|
telnet_timeout: .res 1
|
||||||
connection_closed: .res 1
|
connection_closed: .res 1
|
||||||
telnet_use_native_charset: .res 1 ; 0 means all data is translated to/from NVT ASCII
|
telnet_use_native_charset: .res 1 ; 0 means all data is translated to/from NVT ASCII
|
||||||
buffer_offset: .res 1
|
buffer_offset: .res 1
|
||||||
|
Loading…
Reference in New Issue
Block a user