

bk31415
Members-
Content Count
16 -
Joined
-
Last visited
Community Reputation
0 NeutralTechnical Information
-
Delphi-Version
Delphi 12 Athens
-
OK.
-
Thank you guys. I thought this was a good place to ask technical questions as opposed to philosophical or legal ones. Apparently, I was wrong. Here is the answer using command line. I will use TProcess (ported from FP/Lazarus) until I find a way to do all that natively.
-
Anders, I love the nitpicking. Still, let me answer: No, not userS. Not plural. Both machines (A and B) single-user, they will access one another over the local network --not from Internet or similar. If this is sin in M$ religion, I'll immediately stop using anything that acceses another machine (such as SSH), I promise.
-
Second part applies.
-
I think this discussion is starting to go nowhere. Assigning a different IP address to NIC is already doable with: netsh interface ip set ... here is also a Youtube one. All I want to do is that. Using Delphi. And, I am perfecly fine with "I don't know" or no replies.
-
This must be the strictest possible interpretation out there. I wander what all those people running Web Servers on their personal machines on consumer OSes say about this.
-
Specifically what? I mean, I can assign not just one but several IP addresses to a single NIC under Win11 Ent which I have been able to do for who knows how long. What could be in the EULA to forbid it, while the OS freely allows it? All I want to do is to just that under my own program's control.
-
You could call it that if you go by the choice on the Windows version. But, it isn't really. While me using Delphi may look it, it will be used in professional/serious environment.
-
Call it what you will, but hate the Server versions of Windows with passion. I have installed various versions over the years only to wipe the disks a week later. I'd have never thought I's have such strong feelings against an OS, but WWindows Servers just rub me the wrong way. I am looking for a solution that runs on consumer versions of Windows. I am hoping there's a way to do it.
-
I missed this, hence overlooking the ARP table issue. Don't switches publish updates to ARP table changes up (and down) stream in near-real time?
-
Instead of PING, I can use TCP/UDP client-server code to check one another, which might be simpler. The network consists of 1G/10G wired backend, as well as Wifi5 (2.4 + 5G) which is fairly fast and stable. Ideally, it would be much simpler if I could tell the clients to communicate with 2 (or more) brokers/servers, but I have no control over that feature on the clients which are sometimes tiny IOT devicess. As a result, I have resorted to this idea. BTW, I am using ICS (your brain child) and would like to thank you for it. I have heavily modified the MQTT code. When finished, I might submit it for the next major version. Thank you again.
-
I am writing an (MQTT) broker (serves) that serves about 100 clients. None of this out of ordinary. But, I'd like the machine this thing runs on to have a live backup machine. I.e. an identical machine that takes over in case the master fails. IOW, a High Availability situation. I will be using Windows 11 Pro or Enterprise and both machines will be idetical (clones), except for their static IP addresses. Box A will have, say, 10.xxx.yyy.1 and the other 10.xxx.yyy.2 They will continously ping one another to check that the other is alive. When both are alive, box A will activate a second IP address, such as, 10.xxx.yyy.3 which is the address MQTT broker is listens at. Box B does nothing of the sort. When box A is dead, then box B is activates IP address 10.xxx.yyy.3 where box B's MQTT broker is listening. This is the idea, at least. The first question is, is there a ready-made solution under Windows? Failing that, second question is, do you think this can work? Third question is: How do I dynamically add/remove a second IP address using Delphi?
-
FindNLSStringEx() and next pos
bk31415 replied to bk31415's topic in Algorithms, Data Structures and Class Design
Aha.. The magic eluding me was this: FindNLSStringEx(ALocale, Flags, @AText[AFromPos], Length(AText) - AFromPos, ...); Thank you. -
FindNLSStringEx() and next pos
bk31415 posted a topic in Algorithms, Data Structures and Class Design
I am trying use OS'es FindNLSStringEx() function with Delphi. I've tried to pascalize it. The attraction is that FindNLSStringEx() handles various case sensitivty scenarios. The following code compiles, but I haven't tested in real code to see whether it works as desired, because I cannot figure out how I can locate the next (AFomPos) position for ASubText (the substing). And, without that it is not much use to me. Could someone take a look and show how to do that please. type TNLSFindKind = ( nlsFindFromStart, nlsFindFromEnd, nlsFindStartsWith, nlsFindEndsWith ); TNLSCaseKind = ( nlsLangIgnoreCase, nlsLangIgnoreDiacritic, nlsNormIgnoreCase, nlsNormIgnoreKanatype, nlsNormIgnoreNonspace, nlsNormIgnoreSymbols, nlsNormIgnoreWidth, nlsNormLangCasing ); function TextPos( ASubText: UnicodeString; AText: UnicodeString; AFindKind: TNLSFindKind; ACaseKind: TNLSCaseKind; ALocale: PChar = nil; AFomPos: Integer = 1 ): Integer; var Flags1: DWORD; PFoundLen1: PINT; Pos1: Integer; begin { Returns the index of the first occurence of ASubText in AText, or -1 if the text was not found. } Flags1 := 0; case AFindKind of nlsFindFromStart: Flags1 := Flags1 or FIND_FROMSTART; nlsFindFromEnd: Flags1 := Flags1 or FIND_FROMEND; nlsFindStartsWith: Flags1 := Flags1 or FIND_STARTSWITH; nlsFindEndsWith: Flags1 := Flags1 or FIND_ENDSWITH; end; case ACaseKind of nlsLangIgnoreCase: Flags1 := Flags1 or LINGUISTIC_IGNORECASE; nlsLangIgnoreDiacritic: Flags1 := Flags1 or LINGUISTIC_IGNOREDIACRITIC; nlsNormIgnoreCase: Flags1 := Flags1 or NORM_IGNORECASE; nlsNormIgnoreKanatype: Flags1 := Flags1 or NORM_IGNOREKANATYPE; nlsNormIgnoreNonspace: Flags1 := Flags1 or NORM_IGNORENONSPACE; nlsNormIgnoreSymbols: Flags1 := Flags1 or NORM_IGNORESYMBOLS; nlsNormIgnoreWidth: Flags1 := Flags1 or NORM_IGNOREWIDTH; nlsNormLangCasing: Flags1 := Flags1 or NORM_LINGUISTIC_CASING; end; //SetLastError(0); Pos1 := FindNLSStringEx( ALocale, Flags1, PChar(AText), Length(AText), PChar(ASubText), Length(ASubText), PFoundLen1, nil, nil, 0 ); if (Pos1 = -1) then begin case GetLastError of ERROR_INVALID_FLAGS: raise Exception.Create('Invalid flags'); ERROR_INVALID_PARAMETER: raise Exception.Create('Invalid parameters'); end; Result := -1; end else Result := Pos1; end; -
I led myself to think the reason to be more complex --like count of CRLF's etc. But, 0/1-base issue never occured to me. Thank you.