RTC Forums
November 27, 2024, 01:37:14 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Login
Register
RTC Forums
>
Subscription
>
Support
>
RtcHttpClient reuse address
Pages: [
1
]
« previous
next »
Print
Author
Topic: RtcHttpClient reuse address (Read 4500 times)
twinsoft
RTC License
Posts: 15
RtcHttpClient reuse address
«
on:
June 03, 2020, 12:08:32 PM »
Hi, we need to set the reuse socket property of the undelying socket to true, as we do in Indy with IdTcpClient.ReuseSocket := rsTrue. How can this be done with RtcHttpClient ?
Stefanos
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: RtcHttpClient reuse address
«
Reply #1 on:
June 03, 2020, 12:20:11 PM »
The "SO_REUSEADDR" flag is set by default for TRtcHttpClient components using the WinSock API (useProxy=False; useWinHTTP=False). You can check that by opening the "rtcWinSocket.pas" unit and looking at the "TRtcWinSocket.Connect" method implementation, where you will find this code block ...
else { FProtoType = SOCK_STREAM }
begin
optval := -1;
iStatus := _setsockopt(FHSocket, SOL_SOCKET, SO_REUSEADDR, @optval, SizeOf(optval));
if iStatus <> 0 then
begin
RealSocketError('setsockopt(SO_REUSEADDR)',False);
Exit;
end;
Best Regards,
Danijel Tkalcec
Logged
twinsoft
RTC License
Posts: 15
Re: RtcHttpClient reuse address
«
Reply #2 on:
June 03, 2020, 12:44:42 PM »
Hi, it is also set in TRtcSocket.Sock_SetDelay, which is used in TRtcSocket.Sock_Listen/TRtcSocket.Sock_Connect. This makes me believe that it is also set on other platfroms (apart from Windows). Is this correct ?
Stefanos
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: RtcHttpClient reuse address
«
Reply #3 on:
June 03, 2020, 12:51:22 PM »
Correct. As you've already found out, "SO_REUSEADDR" is set by default for all platforms in the "TRtcSocket.Sock_SetDelay" method in the "rtcSynAPI.pas" unit.
Best Regards,
Danijel Tkalcec
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Dashboard
-----------------------------
=> General
=> 3rd-Party
=> Quick Start
-----------------------------
Subscription
-----------------------------
=> Support
Loading...