Search found 263 matches

by mark_c
Thu Mar 12, 2020 1:12 pm
Forum: Technical
Topic: custom socket set OnError event
Replies: 22
Views: 41120

Re: custom socket set OnError event

I noticed that only error 10054 triggers the OnError event
by mark_c
Thu Mar 12, 2020 6:35 am
Forum: Technical
Topic: custom socket set OnError event
Replies: 22
Views: 41120

Re: custom socket set OnError event

sorry Remy but I must have missed some detail: why the onError event is never activated and instead the onLookup event is activated? //--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Unit1.h" #include "stdio.h" class TMyThread : ...
by mark_c
Tue Mar 10, 2020 3:47 am
Forum: Technical
Topic: Too many connections block the internet traffic
Replies: 4
Views: 11244

Re: Too many connections block the internet traffic

thanks Remy, if I understand correctly the problem I ask myself: is there a way to tell the SO to forget the port and address when I decide to close the connection, maybe after 5 seconds using TClientSocket? this code that I wrote is a kind of simulator, it behaves similarly to a blocking socket, bu...
by mark_c
Mon Mar 09, 2020 1:15 pm
Forum: Technical
Topic: Too many connections block the internet traffic
Replies: 4
Views: 11244

Re: Too many connections block the internet traffic

sorry but in the meantime I discovered that the cause of the block is still the error 10055 despite always closing every socket
by mark_c
Sat Mar 07, 2020 8:09 am
Forum: Technical
Topic: Too many connections block the internet traffic
Replies: 4
Views: 11244

Too many connections block the internet traffic

I am doing tests to understand how many TCP connections can manage windows simultaneously, and I realized that after a certain number of connections, but I have not yet understood how many, if you try to connect to the internet with a browser network traffic everything is blocked. So I was looking f...
by mark_c
Fri Mar 06, 2020 11:00 am
Forum: Technical
Topic: OnTimer event not work
Replies: 20
Views: 34659

Re: OnTimer event not work

Thanks Remy
by mark_c
Wed Mar 04, 2020 12:49 am
Forum: Technical
Topic: OnTimer event not work
Replies: 20
Views: 34659

Re: OnTimer event not work

sorry but I was convinced instead that the thread remained in memory and was terminated only by calling appropriate code. While there are, since with the threads I still have some doubts, after the Open (), or use: __fastcall TMyThread::TMyThread(const AnsiString &Adr) : TThread(true), myadr(Adr) { ...
by mark_c
Tue Mar 03, 2020 1:45 pm
Forum: Technical
Topic: OnTimer event not work
Replies: 20
Views: 34659

Re: OnTimer event not work

sorry but I don't understand where exactly the TClientSocket :: Open () leaves the thread, when I call it for the second time in the OnConnect event?

Thank you
by mark_c
Tue Mar 03, 2020 1:33 am
Forum: Technical
Topic: OnTimer event not work
Replies: 20
Views: 34659

Re: OnTimer event not work

thanks Remy, in the meantime you suggested another idea. If I start with socket ctNonBlocking and make the connection and once the connection is established I use the OnConnect event to close the socket ctNonBlocking and reopen a new one with ctBlocking could it work? Something like this: void __fas...
by mark_c
Mon Mar 02, 2020 3:02 am
Forum: Technical
Topic: OnTimer event not work
Replies: 20
Views: 34659

Re: OnTimer event not work

from what I understand, there is no way to close the socket that is blocked at that moment. It is true to say that there is no way to make a blocking connect time out, but it is not true to say that there is no way to close the socket while it is blocked. There are ways to do it . if you want to sh...
by mark_c
Sun Mar 01, 2020 3:15 pm
Forum: Technical
Topic: OnTimer event not work
Replies: 20
Views: 34659

Re: OnTimer event not work

Sorry I misunderstood
by mark_c
Sun Mar 01, 2020 2:15 am
Forum: Technical
Topic: OnTimer event not work
Replies: 20
Views: 34659

Re: OnTimer event not work

thanks Remy, I understand that it is complex to manage ctNonBlocking sockets in the working threads but I want to learn this too. You tell me you can't call this up within an event if (MySock-> Active) MySock-> Close (); delete MySock; however I don't understand why an exception is not thrown. Anywa...
by mark_c
Sat Feb 29, 2020 4:48 am
Forum: Technical
Topic: OnTimer event not work
Replies: 20
Views: 34659

Re: OnTimer event not work

thanks Remy as always. What I want to learn is to handle non-blocking socket events using threads, for example 20 threads running simultaneously and each time one thread ends, another runs with a new IP address. That's why I asked you about the timer. Initially, thanks to your numerous examples, I t...
by mark_c
Fri Feb 28, 2020 11:36 am
Forum: Technical
Topic: OnTimer event not work
Replies: 20
Views: 34659

Re: OnTimer event not work

at this point is it not better to use the ctNonBlocking sockets and a timer for each thread or would it not make sense?
by mark_c
Fri Feb 28, 2020 7:17 am
Forum: Technical
Topic: OnTimer event not work
Replies: 20
Views: 34659

Re: OnTimer event not work

I tried this version and I expected that after 3 seconds the socket would be closed but it doesn't work: what is the reason? The purpose of the timer is to avoid waiting for 21 seconds before the timeout. As far as I have seen, there is no solution even with threads? void __fastcall TMyThread::MyTim...