Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: What is a socket?
| Subject: | Re: What is a socket? |
| Posted by: | "Richard Bibby" (richard.bib..@profdoc.se) |
| Date: | Tue, 20 Jun 2006 10:23:01 |
Hej,
Here is the code I am using. I have not changed any of the default
properties of the idHTTP component.
try
Response := TMemoryStream.create;
try
Params := TStringStream.create('');
try
idHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
Params.WriteString( URLEncode( Format(
'from_id=%s&username=%s&password=%S&mobile=%S&sms=%s', [co_FromId,
co_SMSUserName, co_SMSPassword, TelNr, smsMessage ] ) ) );
idHTTP.Post( co_SMSURL, Params, Response );
Response.WriteBuffer(#0' ', 1);
if strPos( PChar( Response.Memory), pchar('OK') ) = nil then
SendGuardMessage( gmtError, gmpShowStopper, 'Error from SMS
Service: ' + strpas( pchar( Response.Memory ) ) ); // This send a message
using indy and UDP
finally
Params.Free ;
end ;
finally
Response.Free ;
end ;
except
on E: Exception do
SendGuardMessage( gmtError, gmpHigh, 'Error sending SMS: ' +
E.Message ); // This send a message using indy and UDP
end;
Here are the error messages:
Cound not bind socket Address and port are already in use.
Socket error # 10038. Socket operation on non-socket.
Socket error # 10022. Invalid argument.