(05-08-2018, 08:55 AM)BartKindt Wrote: But now I get an AV:
...
TCPThread.Execute: Start main loop
ERROR: TCPThread.Execute: GStack failed: WIFIInterface=wlan0 Length(WIFIInterface)=5: Access violation at address 90CC4666, accessing address 00000014
An AV at a memory address near 0 usually means you are accessing a nil pointer. My guess would be the TIdTCPClient.Socket.Binding object hasn't been created yet when you call setsockopt(). Try moving that call into the TIdTCPClient.OnSocketAllocated or TIdTCPClient.OnAfterBind event instead. That ensures the Socket.Binding object and its socket Handle are both ready for use.