

Mark-
-
Content Count
303 -
Joined
-
Last visited
-
Days Won
1
Posts posted by Mark-
-
-
38 minutes ago, bazzer747 said:A global search in all files doesn't show anything other than the form where I run the Ace Report from.
Then put a break point in the form button. I am confused how you know where the "report" is launched from and cannot find the "report" unit from the calling location.
-
Using search, search all files in the project for the reporter component name and the unusual file name will be it.
-
1
-
-
20 minutes ago, Alberto Fornés said:Yes, it appears as the last message when I log in and subscribe
OK.
> but I don't receive any messages like I see in MQTT Explorer.
Is it the lack of a confirmation the subscribe was successful? or
Is the value in the server changing and you are not being notified?
-
2 hours ago, Alberto Fornés said:I subscribe to a topic,...
Did you receive a SUBACK response when you subscribed?
-
Or at the bottom right:
-
10 hours ago, Fudley said:Where can I find the Top value please?
I would guess at or near the bottom of the object inspector.
-
Thanks.
Industrial application, lots of networks, binding is necessary in some instances.
-
1
-
-
1 minute ago, Angus Robertson said:In what way was my response unclear?
Angus
Using UDP, how to bind the socket to a NIC or other interface device?
> For UDP client, TWSocket LocalAddr and LocalPort may be set but are usually left blank,...
Does that bind the socket (UDP) to the NIC or whatever the interface device type?
I am trying to make sure I understand, for what I am trying to accomplish, and I want to update the Wiki with more data.
-
4 minutes ago, Angus Robertson said:For UDP server, TWSocket Addr and Port are set for listening.
For UDP client, TWSocket LocalAddr and LocalPort may be set but are usually left blank, the remote address and port are specified in the SendTo method when sending data.
Angus
Thanks for the response.
So, for a UDP server, setting the addr is the interface address and LocalAddr is ignored?
For a UDP client, how to bind the socket to an interface device? Using LocalAddr?
Mark
-
Hello,
The Wiki page https://wiki.overbyte.eu/wiki/index.php/TWSocket
Addr Client: The host to connect to. Server: The interface to listen on.
LocalAddr The local address to which the socket is bound.
Is this true for TCP and UDP?
For a client, Addr is the remote (host) address and LocalAddr, if specified, is the interface to bind the socket.
For a server, Addr specifies the interface to listen on so LocalAddr is not used.
Mark
-
6 hours ago, Remy Lebeau said:I don't think you need to call WsocketErrorDesc() as ESocketException also has an ErrorMessage property.
You are correct, thank you.
-
22 minutes ago, Remy Lebeau said:The error code is stored in the raised ESocketException in its ErrorCode property.
Sounds like a bug that should be reported to the ICS author.
Thank you Remy.
This: WsocketErrorDesc(ESocketException(exceptObject).ErrorCode) works.
I am hoping Angus reads the post.
-
Hello,
Delphi 10.2.3, (VCL) current version of ICS (V9.4).
Testing to verify I caught and handled the issue of the customer entering a bad IP address for binding. The IP address is formatted correctly, just not a valid IP address for any present interface.
I was using the OnError callback. Call connect, onError is called but, "LastError" was zero.
Switched to catching it as an exception try Connect except end; LastError is still zero.
Looked in the source at
procedure TCustomWSocket.BindSocket; ... if WSocket_Synchronized_bind(HSocket, PSockAddrIn(@LocalSockName)^, SockNamelen) <> 0 then begin
and the correct error code 10049 (WSAEADDRNOTAVAIL) is present but, it is never assigned to LastError, that I could see.
Perhaps there is something different I should be doing.
Any ideas?
Thanks,
Mark
-
6 minutes ago, Angus Robertson said:After doing a couple of tests, it seems the SO_BSP_STATE API returns the local address allocated to the socket, usually 0.0.0.0, rather than the address chosen by Windows.
Thank you Angus.
-
2 hours ago, Kas Ob. said:I forgot to mention important thing about that structure and its size.
You can't and must not put it on the stack !, it will overflow and destroy/corrupt the stack, so it must be on the heap and must be zeroed before usage as best practice, because there is two addresses (pointing to two structures) will be filled by that API and it will put them right after the initial structure and fix the addresses.
Thank you.
Not being on the stack is the only difference I see at the moment.
I will give it a go and post the result.
-
6 minutes ago, Angus Robertson said:Sorry, no time to debug this at the moment.
No problem.
I found this on SO.
"... that illustrates that in fact
SO_BSP_STATE
requires a buffer more thansizeof(CSADDR_INFO)
, which is in direct contrast to the Microsoft published documentation: ...Still looking for a working example in any language.
-
7 minutes ago, Angus Robertson said:You should wait until the socket is connected before trying to get socket connected information, use the OnSessionConnected event.
Thanks for the response.
Same result.
-
Well, the wall has been hit.
Not sure what is going on.
Using what I "think" should work ends with:
Replacing
add_info:CSADDR_INFO;
with
add_info:CSADDR_INFO2
and no error.
type SOCKET_ADDRESS = record lpSockaddr:PSOCKADDR; iSockaddrLength:integer; end; type CSADDR_INFO = record LocalAddr:SOCKET_ADDRESS; RemoteAddr:SOCKET_ADDRESS; iSocketType:Integer; iProtocol:Integer; end; type CSADDR_INFO2 = record space:array [0..127] of byte; end; procedure TForm3.FormDestroy(Sender: TObject); begin WSocket1.Abort; end; function GetLastSocketErrorMessage: string; var ErrorCode:integer; Buffer:array[0..255] of Char; begin ErrorCode := WSAGetLastError; if ErrorCode <> 0 then begin FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM or FORMAT_MESSAGE_IGNORE_INSERTS, nil, ErrorCode, 0, Buffer, SizeOf(Buffer), nil ); Result := Format('Socket Error %d: %s', [ErrorCode, StrPas(Buffer)]); end else Result := 'No socket error.'; end; procedure TForm3.FormShow(Sender: TObject); var optLen:integer; add_info:CSADDR_INFO; begin WSocket1.Connect; OptLen:=SizeOf(add_info); FillChar(add_info,OptLen,#0); if WSocket_getsockopt(WSocket1.HSocket, SOL_SOCKET, SO_BSP_STATE, @add_info, OptLen) = SOCKET_ERROR then ShowMessage(GetLastSocketErrorMessage);
Any ideas?
Mark
-
3 minutes ago, Angus Robertson said:I'll put it on my long term wish list, but we seem to have managed for a long time without knowing the real local address.
Thanks Angus.
-
Hello,
A computer with multiple networks interfaces. The "port" and "addr" are set. "LocalAddr" is not set. No SSL.
"Connect" command is called.
The question, how to determine the IP address of the network interface used.
Cheers,
Mark
-
55 minutes ago, Remy Lebeau said:Forget it...
I did, after my last post.
Thanks for your time.
-
3 minutes ago, Remy Lebeau said:Really? They all look the same to me... weird...
I guess you are not comparing them.
Not sure what you are trying to do Remy.
I wrote in the first post, I wanted to use the same script names that TFontDialog displayed.
The matrix I produced has the descriptions, the post you refer to does not have any descriptions used by TFontDialog.
I had to create a few descriptions because TFontDialog did not show the font.
Remy, I know you provide a lot of help on this forum and on other sites. And I have, many times, read your post and thought it was great.
I am not sure you are helping in this thread.
-
7 minutes ago, Remy Lebeau said:Those are all the same values that @Kas Ob. showed you earlier, which Microsoft already documents in several places of MSDN. So you didn't need to go to that effort.
No, it is not the same.
-
29 minutes ago, Charlie Heaps said:What particular compile error are you getting?
It was an API call that had wrong parameters.
What .PAS file does a form use?
in General Help
Posted · Edited by Mark-
Then, unless I am more confused, fRepCompEnrolment is on the same form, in another form declared in a "uses" on the form, or global.
And "CTRL" left clicking on fRepCompEnrolment, in the IDE does nothing?