Re: [twsocket] How to know if a port is being used

2007-09-15 Thread Gustavo Carreno
On 9/15/07, Wilfried Mestdagh <[EMAIL PROTECTED]> wrote: > Just call Listen method in an exception block. If exception then choose > another port and call Listen again, and so on. Either that or Goggle a bit for the source code of a netstat copy-cat application and you'll have the code to investig

Re: [twsocket] How to know if a port is being used

2007-09-15 Thread brian
Use this function and add the following units: wsports and snmp function IsPortFree(Prt: Integer): Boolean; var p: TWSPorts; begin p := TWSPorts.Create; p.Refresh; if p.PortInUse(Prt) then Result:= False else Result:= True; p.Free; end; // // © 2000 Epsylon Software Development // // WSP

Re: [twsocket] How to know if a port is being used

2007-09-15 Thread Wilfried Mestdagh
Hello Éric, Just call Listen method in an exception block. If exception then choose another port and call Listen again, and so on. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, September 15, 2007, 19:09, Éric Fleming Bonilha wrote