BatVink, thanks. I logged into my "Arris" cable modem & don't see an entry to specifically open a port (e.g. 45631) or the AppGameKit port I'm using (1025). Here is the section of the code to Host/Join. As I said, this works fine if I run 2 instances of the .exe on the same computer, but not if I run a copy on 2 different computers on the same home network.
// set window properties
SetWindowTitle( "NetTest" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
// Set up network variables
NetState = 0 // Untried
NetType = -1 // Undefined
NetID = 0 // Undefined
NetName$ = "MyNet"
HostName$ = "Red Host"
ClientName$ = "Blue Client"
NetPort = 1025 // Port
NetActCnt = 0 // Network activity counter
repeat
KeyEsc = GetRawKeyState(27)
KeyH = GetRawKeyState(72)
KeyJ = GetRawKeyState(74)
// If Network State is untried
if NetState = 0
// display instructions
Print ( "Hit <H> to Host" )
Print ( "Hit <J> to Join" )
// If H key
if KeyH
NetID = HostNetwork ( NetName$, HostName$, NetPort )
NetType = 0 // Host
NetState = 1 // Tried
endif
// If J key
if KeyJ
NetID = JoinNetwork ( NetName$, ClientName$ )
NetType = 1 // Client
NetState = 1 // Tried
endif
endif
// If Network was tried, but could not host/join, then display failure
if (NetState=1 and NetID=0)
print ("Network connection failed")
endif
// If Network was tried & sucessfully hosted or joined
if ( NetState=1 and NetID>0 )
// Display status
printc ("Network active: ")
if (IsNetworkActive ( NetID )) then inc NetActCnt
printc (NetActCnt) : printc(" ")
// If Network is active
if IsNetworkActive ( NetID ) <> 0
// Get Network ID of first client
AnyID = GetNetworkFirstClient ( NetID )
// If client ID is valid
while AnyID <> 0
// Show current client
Print ( GetNetworkClientName ( NetID, AnyID ) )
// Find next client
AnyID = GetNetworkNextClient ( NetID )
endwhile
endif
endif
// If Host & client active, then send & receive data
// Other magic happens...
Sync()
until (KeyEsc)
Code every line like it might be your last...
Someday it will be.