A little error in my code.
I repost it

----- Original Message ----- 
From: "Engi" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Wednesday, November 22, 2006 8:24 AM
Subject: [twsocket] Connect, send and close


 bool __fastcall TfrmMain::SendCde(int PortIP, AnsiString Cde)
{
    bool Result;
    int Sent;

    WSocket->LineMode = true;
    WSocket->LineEnd = "\r\n";
    WSocket->Proto  = "tcp";
    WSocket->Port  = PortIP;
    WSocket->Addr  = AdrIP;

    WSocket->Connect();

    if
    {
        Sent = WSocket->SendStr(Cde + "\r\n");
        Result = (Sent == Cde.Length());
    }
    else
    {
        Result = false;
    }

    if ((WSocket->State == wsConnected) || (WSocket->State == wsConnecting))
        WSocket->Close();

    return Result;
}


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to