diff --git a/RADRunner.cpp b/RADRunner.cpp index 8d4c663..cb4ed35 100644 --- a/RADRunner.cpp +++ b/RADRunner.cpp @@ -247,7 +247,33 @@ static TResult StartClient(unsigned short a_port) if (g_args[ARGS_REMOTE] != nullptr) { - if (socket.open(g_args[ARGS_REMOTE], a_port) == KErrNone) + int serverLength, portLength, port; + TLex lex(g_args[ARGS_REMOTE], static_cast(strlen(g_args[ARGS_REMOTE]))); + + lex.SetWhitespace(":"); + + /* Extract the server name and port number from the remote name passed in and, if a port was specified, */ + /* convert it and check its validity */ + const char *serverString = lex.NextToken(&serverLength); + const char *portString = lex.NextToken(&portLength); + + std::string server = std::string(serverString, serverLength); + + /* The port string is optional so only parse if it is there, and use the default value if it is missing */ + /* or invalid */ + if (portString) + { + if (Utils::StringToInt(portString, &port) == KErrNone) + { + a_port = static_cast(port); + } + else + { + Utils::Error("Specified port \"%s\" is invalid, using default port %d", portString, a_port); + } + } + + if (socket.open(server.c_str(), a_port) == KErrNone) { try { @@ -311,7 +337,7 @@ static TResult StartClient(unsigned short a_port) } else { - Utils::Error("Cannot connect to %s", g_args[ARGS_REMOTE]); + Utils::Error("Cannot connect to %s:%d", server.c_str(), a_port); } } else diff --git a/README.md b/README.md index 1266c1d..1bce172 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,15 @@ And to use that from a remote computer: d:\Source> RADRunner vampire PORT 68000 DIR RAM: ``` +Note that when connecting to a remote computer, the port can also be specified as a part of the server name or IP +address. For instance: + +```shell +d:\Source> RADRunner vampire:68000 DIR RAM: +``` + +In this case, the port specified as a part of the server name overrides the port specified with the PORT command. + ### SCRIPT/K \ Executes a number of commands inside the RADRunner script file specified by \. See the section "Script Support" diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 9b5a574..24d77f7 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,12 +1,23 @@ -Regarding the release status of RADRunner, it is currently in beta. New releases -that are built by GitHub may or may not contain improvements, as the builds are -triggered automatically by code merges, so sometimes a build contains only internal -non functional changes. +This ReleaseNotes.txt was added by the author on request from a user. Until now, the author wasn't aware that the +application actually had any users! -If a build does contain a new feature or bugfix, I'll try to remember to add it to -this file with the build's release date. +Please note that RADRunner is currently in beta. Until version 1.0, binary compatibility between releases is not +guaranteed. When a new build has a binary break, it will be mentioned here. Once version 1.0 is released, it will +contain a mechanism for detecting incompatible client and server versions. + +New releases that are built by GitHub may or may not contain improvements, as the builds are triggered automatically +by code merges, so sometimes a build contains only internal non functional changes. + +If a build does contain a new feature or bugfix, I'll try to remember to add it to this file with the build's release +date. Have fun with the Amiga! Colin Ward AKA Hitman/Code HQ + +Version 0.01 (2024.04.24): + + - First public release + + - Added ability to specify the server port as a part of the remote host name, for example localhost:8080