2023年10月26日 星期四

delphi iocp socket tcpip network

     
https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/
http://www.ararat.cz/synapse/doku.php/download
         Ararat Synapse Code  SynaSer serial library Synapse TCP/IP and serial library Winsock
http://visualsynapse.sourceforge.net/  
         VisualSynapse TCP/IP Delphi components based on Synapse.
http://synapse.ararat.cz/files/contrib/  
         Contributed Download Area - various samples and others.
http://synapse.ararat.cz/files/crypt/  
         Crypting libraries for SSL/TLS/SSH in Synapse
http://synapse.ararat.cz/files/W95ws2setup.exe  
         Winsock2 support for Windows95
http://www.wireshark.org/  
         Wireshark excellent tool for analyse and debugging of network communication.
https://www.nsoftware.com
https://www.nsoftware.com/products/
         Internet Communications and Security

voipobjects delphi-iocp-library voipobjects delphi-iocp-library  http://voipobjects.com/

https://github.com/tondrej/iocp-delphi
         Windows IO Completion Port wrapper class for Delphi and Free Pascal
          compilers: Delphi 7 or higher, Free Pascal 3.0.4 or higher
          targets: Windows XP/Windows Server 2003 or higher, both 32 and 64-bit

Fiber and IOCP API siqiyi/libfiber The high performance coroutine library
GitHub iqiyi libfiber OS platfroms including Linux, FreeBSD, MacOS, and Windows, which supports
 select, poll, epoll, kqueue, iocp, and even Windows GUI messages

Using beamer overlays with forest generated trees

HPScktSrvr at http://www.torry.net/ with the code pages.php?id= and a number sequence of 220#939383

Indy, ICS, Synapse, and Clever InetSuite,
ICS - The Internet Component Suite

iocpengine iocpengine - I/O Completion Port Engine for Delphi

TISAPIThreadPool; TIstringHelper; TIWPaintHandler. TIWPaintHandlerDsn. TIWPaintHandlerButton; TIWPaintHandlerCheckBox; TIWPaintHandlerComboBox ...

HttpSys2WebServer from DWScript use an IOCP-based server.

https://torry.net/components/internet/sockets/#939383

https://habr.com/ru/articles/145140/
Windows Sockets, IOCP и Delphi



//////////////////////////////////////////////////////////////////////////////////////////////////////
 Создание списков сокетов разных типов.
Инициализация подсистемы сокетов.
Создание очереди сообщений.
Создание пула для обработки очереди.
Создание событий для сокетов.
Создание потоков отслеживающих сокетные события( например подключение нового клиента)
procedure Init;
var
  WSAData: TWsaData;
  i: Integer;
begin
  gClients := TProtoStore.Create;
  gListeners := TProtoStore.Create;
  gServerClients := TProtoStore.Create;
  if WSAStartup(MAKEWORD(2, 2), WSAData) <> 0 then
    raise IOCPClientException.Create(sErrorInit_WSAtartup);
  gIOCP := CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, CPUCount * 2);
  if gIOCP = INVALID_HANDLE_VALUE then
    raise IOCPClientException.Create(sErrorInit_CreateIoCompletionPort);
  for i := 1 to CPUCount * 2 do
 begin
    SetLength(gWorkers, Length(gWorkers) + 1);
    gWorkers[Length(gWorkers) - 1] := TWorkerThread.Create();
  end;
  gListenerAcceptEvent := WSACreateEvent;
  if gListenerAcceptEvent = WSA_INVALID_EVENT then
    raise IOCPClientException.Create(sErrorInit_WSACreateEvent);
  gServerClientsCloseEvent := WSACreateEvent;
  if gServerClientsCloseEvent = WSA_INVALID_EVENT then
    raise IOCPClientException.Create(sErrorInit_WSACreateEvent);
  gClisentsConnectAndCloseEvents := WSACreateEvent;
  if gClisentsConnectAndCloseEvents = WSA_INVALID_EVENT then
    raise IOCPClientException.Create(sErrorInit_WSACreateEvent);
  gClientSocketEventThread := TSocketEventThread.Create
    (gClisentsConnectAndCloseEvents, gClients, ET_EVENT_SIGNALED);
  gClientSocketEventThread.Start;
  gServerClientsSocketEventThread := TSocketEventThread.Create
    (gServerClientsCloseEvent, gServerClients, ET_EVENT_SIGNALED);
  gServerClientsSocketEventThread.Start;
  gServerSocketEventThread := TSocketEventThread.Create(gListenerAcceptEvent,
    gListeners, ET_EVENT_SIGNALED);
  gServerSocketEventThread.Start;
end;

沒有留言: