Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: What is a socket?

www.cryer.info
Managed Newsgroup Archive

Re: What is a socket?

Subject:Re: What is a socket?
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Tue, 20 Jun 2006 10:29:07

"Richard Bibby" <richard.bibby@profdoc.se> wrote in message
news:4497b065$1@newsgroups.borland.com...

> Here is the code I am using.  I have not changed any of
> the default properties of the idHTTP component.

Try this:

    var
        Response: String;
        Params: TStringList;
    begin
        try
            Params := TStringList.Create;
            try
                IdHTTP.Request.ContentType :=
'application/x-www-form-urlencoded';
                Params.Add('from_id=' + co_FromId);
                Params.Add('username=' + co_SMSUserName);
                Params.Add('password=' + co_SMSPassword);
                Params.Add('mobile=' + TelNr);
                Params.Add('sms=' + smsMessage);

                Response := IdHTTP.Post(co_SMSURL, Params);
                if Pos('OK', Response) = 0 then
                    SendGuardMessage(gmtError, gmpShowStopper, 'Error from
SMS Service: ' + Response);
            finally
                Params.Free;
            end ;
        except
            on E: Exception do
                SendGuardMessage(gmtError, gmpHigh, 'Error sending SMS: ' +
E.Message);
        end;
    end;

> Here are the error messages:

You have 3 messages.  Does that mean that you are calling your code three
times, and each time returns a different error?  Or are you seeing three
errors happen all at one time?

> Cound not bind socket Address and port are already in use.

Without setting the BoundIP and BoundPort properties, that error is almost
impossible to occur in a client.  You would have to be using a LOT of ports
on your machine for that to happen.  By default, a client socket uses a
random port so that particular error does not occur in the first place.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive