Skip to content

Commit

Permalink
Shift async execution protocol into host interface library, more clea…
Browse files Browse the repository at this point in the history
…nup. #149
  • Loading branch information
Falk Rehwagen committed Oct 4, 2024
1 parent 3706670 commit 86ced8a
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 536 deletions.
12 changes: 0 additions & 12 deletions Driver/Socket/HstTCPIP/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,6 @@ _PROTO = 7.2
#
#GOCFLAGS += -CTcpipClassStructures

# STATIC_LINK_RESOLVER
# This flag causes the resolver library to be statically linked to the
# driver, rather than dynamically loaded and unloaded for
# starting and stopping every IP address resolution. For devices with
# slow file access and little or no cache, this speeds things up since
# GeodeUseLibrary performs a geode search by long filename on each call.
# (Besides, resolve's fixed memory footprint when inactive is only
# 800 bytes...)

ASMFLAGS += -DSTATIC_LINK_RESOLVER
LINKFLAGS += -DSTATIC_LINK_RESOLVER

#include <$(SYSMAKEFILE)>


Expand Down
125 changes: 0 additions & 125 deletions Driver/Socket/HstTCPIP/tcpip.def
Original file line number Diff line number Diff line change
Expand Up @@ -126,29 +126,6 @@ RegisterStatus record
RegisterStatus end



GeosHostNetConnectCallbackData struct
; input
GHNCCD_callback fptr
GHNCCD_semaphore word
GHNCCD_semaphore2 word

; output
GHNCCD_result word

GeosHostNetConnectCallbackData ends

GeosHostNetDisconnectCallbackData struct
; input
GHNDCD_callback fptr
GHNDCD_semaphore word
GHNDCD_semaphore2 word

; output
GHNDCD_result word

GeosHostNetDisconnectCallbackData ends

COMMENT |-----------------------------------------------------------------

The following data structure is used to preserve packet boundaries when
Expand Down Expand Up @@ -334,109 +311,7 @@ else
TcpipProcessClass class ProcessClass
endif

MSG_TCPIP_OPEN_CONNECTION_ASM message
; SYNOPSIS: start the process required to open a connection
;
; PASS: cx = connection handle
; RETURN: nothing
; DESTROYS: nothing
;

MSG_TCPIP_CLOSE_CONNECTION_ASM message
; SYNOPSIS: start the process to close a connection
;
; PASS: cx = connection handle
; RETURN: nothing
; DESTROYS: nothing
;

MSG_TCPIP_RESET_CONNECTION_ASM message
; SYNOPSIS: start the process to reset a connection
;
; PASS: cx = connection handle
; dx = SocketDrError
; RETURN: nothing
; DESTROYS: nothing
;

MSG_TCPIP_ACCEPT_CONNECTION_ASM message
; SYNOPSIS: start the process to accept a connection requested by the peer
;
; PASS: cx = connection handle
; RETURN: nothing
; DESTROYS: nothing
;

MSG_TCPIP_SEND_DATA_ASM message
; SYNOPSIS: process outgoing data for a connection
;
; PASS: cx = connection handle
; dx = SocketSendMode
; RETURN: ax = SocketDrError
; DESTROYS: nothing
;

MSG_TCPIP_SEND_DATAGRAM_ASM message
; SYNOPSIS: send a datagram
;
; PASS: cx = link domain handle
; dx:bp = data buffer
; RETURN: ax = SocketDrError
; DESTROYS: nothing

MSG_TCPIP_RECEIVE_DATA_ASM message
; SYNOPSIS: process incoming data from the link
;
; PASS: nothing
; RETURN: nothing
; DESTROYS: nothing
;

MSG_TCPIP_TIMEOUT_OCCURRED_ASM message
; SYNOPSIS: process a timeout
;
; PASS: nothing
; RETURN: nothing
; DESTROYS: nothing
;

MSG_TCPIP_DELETE_LINK_ASM message
; SYNOPSIS: delete a link and terminate tcp's existence if no other links exist
; [TCP should only send this to itself if it has no registered clients.]
;
;
; PASS: cx = domain handle of link
; RETURN: nothing
; DESTROYS: nothing
;

MSG_TCPIP_DESTROY_CONNECTIONS_ASM message
; SYNOPSIS: Destroy all Tcp connections. They should all be dead.
;
; PASS: nothing
; RETURN: nothing
; DESTROYS: ax, cx, dx, bp

MSG_TCPIP_SEND_RAW_IP_ASM message
; SYNOPSIS: send a raw ip packet
;
; PASS: dx:bp = data buffer
; cx = RawIpFlags
; RETURN: ax = SocketDrError
; DESTROYS: nothing

MSG_TCPIP_DHCP_RENEW_TIMER_ASM message
; SYNOPSYS: Sent by timer to handle DHCP lease renewal
;
; Don't directly send.

MSG_TCPIP_DHCP_RENEW_NOW_ASM message
; SYNOPSYS: Sent by timer to handle DHCP lease renewal
;
; Don't directly send.

MSG_TCPIP_START_RECEIVE_ASM message
MSG_TCPIP_ASYNC_UNLOCK_ASM message


ifdef PASCAL_CONV
Expand Down
100 changes: 34 additions & 66 deletions Driver/Socket/HstTCPIP/tcpip.goc
Original file line number Diff line number Diff line change
Expand Up @@ -4,73 +4,15 @@
extern void
_pascal TcpipReceiveStart(word link);

/***/
extern word
_pascal TcpipDetachAllowed (void);


@class TcpipProcessClass, ProcessClass;

/*
* Start the process required to open a connection.
*/
@message void MSG_TCPIP_OPEN_CONNECTION(word connection = cx);

/*
* Start the process to close a connection.
*/
@message void MSG_TCPIP_CLOSE_CONNECTION(word connection = cx);

/*
* Start the process to reset a connection.
*/
@message void MSG_TCPIP_RESET_CONNECTION(word connection = cx, word error = dx);

/*
* Start the process to open a connection requested by the peer.
*/
@message void MSG_TCPIP_ACCEPT_CONNECTION(word connection = cx);

/*
* Process outgoing data for a connection.
*/
@message word MSG_TCPIP_SEND_DATA(word connection = cx, word mode = dx) = ax;

/*
* Send datagram.
*/
@message word MSG_TCPIP_SEND_DATAGRAM(word link = cx, optr buffer = dx:bp) = ax;

/*
* Process incoming data from the network.
*/
@message void MSG_TCPIP_RECEIVE_DATA();

/*
* Process a timeout.
*/
@message void MSG_TCPIP_TIMEOUT_OCCURRED ();

/*
* Delete a link.
*/
@message void MSG_TCPIP_DELETE_LINK (word link = cx);

/*
* Destroy all Tcp connections.
*/
@message void MSG_TCPIP_DESTROY_CONNECTIONS ();

/*
* Send a raw ip packet.
*/
@message word MSG_TCPIP_SEND_RAW_IP(word link = cx, optr buffer = dx:bp) = ax;

/*
* DHCP lease renewal messages
*/
@message void MSG_TCPIP_DHCP_RENEW_TIMER();
@message void MSG_TCPIP_DHCP_RENEW_NOW();
@class TcpipProcessClass, ProcessClass;

@message void MSG_TCPIP_START_RECEIVE();
@message void MSG_TCPIP_ASYNC_UNLOCK(word sem = cx);

@endc;

Expand All @@ -79,12 +21,38 @@ extern void

@classdecl TcpipProcessClass, neverSaved;

/*-------------------------------------------------------------------------
MSG_META_DETACH
---------------------------------------------------------------------------
SYNOPSIS: Intercepted to prevent TCP from exiting before clients do.

PASS: callerID
caller

RETURN: nothing

STRATEGY: If it is safe to exit TCP, call superclass.
Else, do nothing.

REVISION HISTORY:
Name Date Description
---- ---- -----------
jwu 1/23/95 Initial Revision

-------------------------------------------------------------------------*/
@method TcpipProcessClass, MSG_META_DETACH
{
if (TcpipDetachAllowed())
@callsuper();

} /* End of MSG_META_DETACH. */





@method TcpipProcessClass, MSG_TCPIP_START_RECEIVE {

TcpipReceiveStart(0);
}

@method TcpipProcessClass, MSG_TCPIP_ASYNC_UNLOCK {

ThreadVSem(sem);
}
Loading

0 comments on commit 86ced8a

Please sign in to comment.