Using unit Sockest & Lazarus lazarus / 8-Other ---------------------------------------------------------------------- Ole JR · 2005-11-04 22:04 Quick example code: Code: [Select]program test; {$mode objfpc}{$H+} uses   Classes, Sockets; begin   if(Socket(AF_INET, SOCK_STREAM, 0) < 0) then   begin     writeln('Socket failed..');     readln();     exit;   end;   writeln('Socket ok..');   readln(); end. Question: Why won't this run multiple times in Lazarus? I load up Lazarus, open the example, press F9 to compile/run = Work as intended.. BUT if I recompile/run it again, Socket return -1, no matter what.. So... If I close and open Lazarus, it works again.. That one time.. And yes, I've also used a CloseSocket() in there, same result. If I run the same exe from command prompt it works  :? Any ideas?? Ole JR