Ignore:
Timestamp:
Nov 19, 2012, 2:43:40 PM (12 years ago)
Author:
chronos
Message:
  • Fixed: Thread safe access to serial port pin interface using lock.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • PinConnection/UCommTCPServer.pas

    r413 r440  
    77uses
    88  Classes, SysUtils, blcksock, synsock, UCommPin, UCommon, UThreading,
    9   DateUtils, SpecializedList, tlntsend;
     9  DateUtils, SpecializedList;
    1010
    1111type
     
    4848    FOnConnect: TSocketConnectEvent;
    4949    FOnDisconnect: TSocketConnectEvent;
    50     FOnReceiveData: TReceiveDataEvent;
     50    //FOnReceiveData: TReceiveDataEvent;
    5151    FReceiveThread: TCommSocketReceiveThread;
    52     procedure SetActive(const AValue: Boolean);
     52  protected
     53    procedure SetActive(const AValue: Boolean); override;
    5354  public
    5455    Sessions: TListObject; // TListObject<TCommTCPServerSession>
     
    7475    Mem := TMemoryStream.Create;
    7576    Stream.WriteToStream(Mem);
     77    Mem.Position := 0;
    7678    Socket.SendStreamRaw(Mem);
    7779  finally
     
    172174  if AValue then begin
    173175    Socket.Bind(Address, IntToStr(Port));
    174     if Socket.LastError <> 0 then raise Exception.Create('Bind error');
     176    if Socket.LastError <> 0 then raise Exception.Create('Bind error' + Socket.GetErrorDesc(Socket.LastError));
    175177    Socket.Listen;
    176178    if Socket.LastError <> 0 then raise Exception.Create('Listen error');
Note: See TracChangeset for help on using the changeset viewer.