A little error in my code.
I repost it
- Original Message -
From: "Engi" <[EMAIL PROTECTED]>
To: "ICS support mailing"
Sent: Wednesday, November 22, 2006 8:24 AM
Subject: [twsocket] Connect, send and close
bool __fastcall TfrmMain::SendCde(int PortIP, AnsiString Cde)
{
bool Result
Hi,
I need a "client" function that connects to server, send data and close
connection.
My code is :
bool __fastcall TfrmMain::SendCde(int PortIP, AnsiString Cde)
{
bool Result;
int Sent;
WSocket->LineMode = true;
WSocket->LineEnd = "\r\n";
WSocket->Proto = "tcp";
WSocket->Port = PortI
Hi,
How can I used a PC without network cable connected (WinXP), to
do broadcast with UDP. i.e.
Create 1 Send socket with
Send.Addr= '255.255.255.255'
Send.LocalAddr = '127.0.0.1'
Send.ReuseAddr = true
And few Listen socket
Listen.Addr = '0.0.0.0'
Listen.LocalAddr
> Thanks for the pointer. The error is 10035.
As you can see in the docs, it is WSAEWOULDBLOCK. This not a real error in a
non-blocking environment. It just mean the winsock call would block to
execute the task and non-blocking mode has been selected.
--
Contribute to the SSL Effort. Visit http
OK, by going over the clidemo and TCPServ projects (which successfully
communicate with each other) with a fine-toothed comb, and setting all my
design-time and run-time properties, etc., as in those demos, I was able to
get it to work.
Bravo! Salud! Hallelujah! Etc.
-Original Message-
Fr
Francois Piette wrote:
>> I'm using THttpServer to send a document myself (using hgWillSendMySelf)
>> so I can keep sending new data without requiring a new connection. It
>> works just fine. Now I want to do the same the other way around: I want
>> to use THttpCli to continually "post" data, witho
Hello Clay,
> OK, by going over the clidemo and TCPServ projects (which successfully
> communicate with each other) with a fine-toothed comb, and setting all my
> design-time and run-time properties, etc., as in those demos, I was able to
> get it to work.
Good :)
---
Rgds, Wilfried [TeamICS]
<< Maybe a typo error ?>>
No, all that code was copied-and-pasted from TCPSrv1.pas.>>
--The 10048 problem seemed to stem from some redundant code:
procedure TfClientMain.FormShow(Sender: TObject);
begin
ApplicationEvents.OnException := ApplicationEventsException;
if WSocketServer.Addr <> '0
Hello Francois,
Thanks for the pointer. The error is 10035.
Best Regards,
SZ
On 11/21/06, Francois Piette <[EMAIL PROTECTED]> wrote:
> > What could be the reason? Any idea?
>
> Cal WSAGetLastError to know the error code.
> --
> [EMAIL PROTECTED]
> Author of ICS (Internet Component Suite, freewa
> Which TWSocketServer event should I code to retrieve incoming data?
Define a private procedure like this :
procedure ClientDataAvailable(Sender: TObject; Error: Word);
In the OnClientConnect event, you have to assign an event handler to
your client socket.
Something like this :
Client.OnDat
I do not think the issue understood the same here and there. Why is
the Count = -1 then? What should one do to have the sync method work?
(I have changed the mode to sync, I hope you noticed. See the code I
posted in my __first__ email.)
Regards,
SZ
On 11/21/06, Francois PIETTE <[EMAIL PROTECTED
> Using hgWillSendMySelf I noticed the proxy server immediately connects
> the client to the server and the connection is kept open as long as I'm
> sending data. If the proxy server does the same for the "long HTTP post"
> it would provide a very valuable tool for what I need.
I wouldn't base my
When I send a string from my test utility, the ClientConnect() event(*)
fires in my app, which is listening for messages, but the
ClientDataAvailable() event(**) is not fired.
And when I send the message a second time from the test utility, I get
"Connect: socket already in use".
Also, the
> << Alternatively, you may send your data in text form instead of binary
> form.
> It takes more space but you have no problem with line end terminator (The
> default CRLF is perfect) and you avoid problem with binary representation
> of
> data which DIFFER from one processor to another processor
<< See TTcpSrvForm.WSocketServer1ClientConnect in TcpSrv1.pas source.>>
When I try to use that code, I get an EInvalidCast error, specifically,
"EInvalidCast - Invalid class typecast" on this line:
with Client as TTcpSrvClient do begin
of the OnClientConnect() event handler.
And this even tho
There is no IMAP component in ICS. Sorry.
Maybe you'll write it ?
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be
- Origin
<<> OnDataAvailable() should only fire once for each record, because I am
> having
> the sender add a #126 (~) as the last byte of each record, and using
> LineMode with LineEnd = #126.
WARNING: Since your record contains binary data, it could contains a #126 as
part of the data. So the line mod
> it's ok for the server part ?
> is it the same method for the client part (to send data to server) ?
No matter which side you are talking about. It is the same class -
TWSocket - which handle the connection at both ends. So the methods,
properties and events are the same.
--
Contribute to the
Hi,
I have a TWSocketServer which is listening incoming clients connections.
Once a client is connected, the server send data to it.
Sometimes, I need this client to send command to the server.
Is it possible with ics components ?
If yes, how can I do it ?
TIA,
Engi
--
To unsubscribe or change y
Hello,
In our ISAPI server, if the request is detected to be of a ISAPI
interpreter one, we run the routine,
OldDataAvailable = FOnDataAvailable;
OldSendData = FOnSendData;
OldDataSent = FOnDataSent;
FOnDataAvailable = NULL;
FOnSendData = NULL;
FOnDataSent = NULL;
int iMode = 0;
WSocket_ioctlso
Francois Piette wrote:
> Because it would need to create a try/finally frame which would have an
> impact on the performance given the high rate the events may be triggered
> when speaking about network I/O. And it is very easy for the component user
> to use a flag to detect reentrancy in his own
it's ok for the server part ?
is it the same method for the client part (to send data to server) ?
- Original Message -
From: "Francois PIETTE" <[EMAIL PROTECTED]>
To: "ICS support mailing"
Sent: Monday, November 20, 2006 6:56 PM
Subject: Re: [twsocket] How server can send data to clie
Here is an idea: (HTTP uses this logic). Send a header with the
content-length first then cut the data wrt that.
Regards,
SZ
On 11/20/06, Francois PIETTE <[EMAIL PROTECTED]> wrote:
> > << Alternatively, you may send your data in text form instead of binary
> > form.
> > It takes more space but y
Which TWSocketServer event should I code to retrieve incoming data?
I'm sending data from a test util (using TWSocket), and have SHowMessage()
code in the following events:
WSocketServerClientConnect()
WSocketServerDataAvailable()
WSocketServerDataSent()
WSocketServerSendData()
WSocketS
<< I don't understand what you "real" app is. It is your server
application?>>
Yes. I'm trying to send it the data from a test util (in actuality, the data
will come from a real-time system).
<>
Not right now.
<>
OK -- I was using the Client5 and Server5 demos as a starting point, where
both t
Can somebody point me to documentation that gives an overview of what
TICSLogger does and how to use it? Is there a demo that features it?
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. If the
> I'm using THttpServer to send a document myself (using hgWillSendMySelf)
> so I can keep sending new data without requiring a new connection. It
> works just fine. Now I want to do the same the other way around: I want
> to use THttpCli to continually "post" data, without closing the
connection.
>I do not think the issue understood the same here and there. Why is
> the Count = -1 then?
When you call Send, passing a number of bytes and send is not able to send
it without blocking and non-blocking mode is active, then send returns -1 to
tell you it can't do what you asked. Nothing is sent
- Original Message -
From: "Cosmin Prund" <[EMAIL PROTECTED]>
To: "ICS support mailing"
Sent: Monday, November 20, 2006 10:16 AM
Subject: Re: [twsocket] What might cause ICS to fail and we need to be aware
of?
> Francois Piette wrote:
>> I don't know of ANY component where it is safe
If I add this line of code (from TcpSrv1.pas):
PostMessage(Handle, WM_APPSTARTUP, 0, 0);
To the FormShow() event, I get this error msg:
"ESocketException - Error 10048 in function Bind Address already in use."
On the last line (Listen) of this code:
procedure TfClientMain.WMAppStartup(var Ms
> << See TTcpSrvForm.WSocketServer1ClientConnect in TcpSrv1.pas source.>>
>
> When I try to use that code, I get an EInvalidCast error, specifically,
> "EInvalidCast - Invalid class typecast" on this line:
>
> with Client as TTcpSrvClient do begin
>
> of the OnClientConnect() event handler.
TWS
> I have a TWSocketServer which is listening incoming clients connections.
> Once a client is connected, the server send data to it.
> Sometimes, I need this client to send command to the server.
> Is it possible with ics components ?
> If yes, how can I do it ?
When the client is connected to the
Hello everyone.
I'm using THttpServer to send a document myself (using hgWillSendMySelf)
so I can keep sending new data without requiring a new connection. It
works just fine. Now I want to do the same the other way around: I want
to use THttpCli to continually "post" data, without closing the
Francois Piette wrote:
> I don't know of ANY component where it is safe to call the message pump from
> one of its event without knowing what happend. Even for a simple
> TButton.OnClick, you can get strange result if you call the message pump
> within the OnClick handler because the handler is re-
Thanks
- Original Message -
From: "Francois PIETTE" <[EMAIL PROTECTED]>
To: "ICS support mailing"
Sent: Monday, November 20, 2006 8:04 PM
Subject: Re: [twsocket] How server can send data to clients ?
>> it's ok for the server part ?
>> is it the same method for the client part (to send
> Which TWSocketServer event should I code to retrieve incoming data?
None !
Data doesn't come from TWSocketServer but from one TWSocketClient (another
TWSocket derived class) which is instanciated for each incomming connection.
See how it works in TcpSrv sample program.
> The two that fire whe
> << Right. But since you send integer data type, you WILL have #126 in the
> binary data !>>
>
> In the infamous words of Kip Dynamite, "Dang it"
>
> Is there any LineEnd value I can set that will be safe to assume it won't
> get sent in integer data?
Defenitely none !
> Or will I need to pu
Francois PIETTE wrote:
>
> IMO, you have all the required tools !
Yes, no question, you realy have all the required tools. But you
also have the required tools to write a SMTP client using TWSocket,
and nevertheless there's a SMTP client in ICS. What I mean is that
it won't hurt to put that in, b
I want to add:
1) ISAPI must have sync sockets
2) when I go through breakpoints, no -1's are returned and the sample
jpg returned by the ISAPI extension works perfectly. (no corruption)
Best Regards,
SZ
On 11/21/06, Fastream Technologies <[EMAIL PROTECTED]> wrote:
> Hello,
>
> In our ISAPI serv
Clay Shannon wrote:
>>
>> "ESocketException - Error 10048 in function Bind Address already in
>> use."
Another socket is already listening on the same IP and port.
---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
--
To unsubscribe or change your settings for TWSock
> < housekeeping needed to handle simultaneous clients.>>
>
> OK -- I was using the Client5 and Server5 demos as a starting point, where
> both the sender and receiver are TWSocket components, are they not?
Server5 is a very very old sample program...
It use TWSocket as server socket. That's fine
> What could be the reason? Any idea?
Cal WSAGetLastError to know the error code.
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be
- Original Message -
From: "Fastream Technologies" <[EMAIL P
<< Alternatively, you may send your data in text form instead of binary
form.
It takes more space but you have no problem with line end terminator (The
default CRLF is perfect) and you avoid problem with binary representation of
data which DIFFER from one processor to another processor.>>
So se
> <<> OnDataAvailable() should only fire once for each record, because I am
> > having
> > the sender add a #126 (~) as the last byte of each record, and using
> > LineMode with LineEnd = #126.
>
> WARNING: Since your record contains binary data, it could contains a #126
as
>
> part of the data. So
Oh, never mind, I see it in your other answer now (I'm reading answers
posted over the weekend and this mailing list (live) simultaneously),
namely:
MyOpCode := PInteger(@Buffer)^;
Thanks, Francois!
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Clay Sh
Hello Clay,
Seems you mix up 2 different things:
> When I send a string from my test utility, the ClientConnect() event(*)
> fires in my app, which is listening for messages, but the
> ClientDataAvailable() event(**) is not fired.
You cannot send data if there is no connection. The OnClientConne
<< Right. But since you send integer data type, you WILL have #126 in the
binary data !>>
In the infamous words of Kip Dynamite, "Dang it"
Is there any LineEnd value I can set that will be safe to assume it won't
get sent in integer data?
Or will I need to pull out the OpCode any time a reco
> I noticed something.
>
> If in the OnDocData event handler of THttpCli I somehow re-enter the
> "message pump" (that is, do something that calls
> Application.HandleMessage or Application.ProcessMessages) the downloaded
> file is corrupted! It took me a while to find this out and now I'm asking:
> If I add this line of code (from TcpSrv1.pas):
>
> PostMessage(Handle, WM_APPSTARTUP, 0, 0);
>
> To the FormShow() event, I get this error msg:
>
> "ESocketException - Error 10048 in function Bind Address already in use."
Error 10048 occurs when you try to make a socket listening on a port alr
Thank you for the code. I have solved the problem. It was caused by other
modules which are not thread safe. The bug ate up HttpSvr's memory space.
Best regards,
Kyin
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of éric Fleming Bonilha
Sent: Sunday, Nove
I noticed something.
If in the OnDocData event handler of THttpCli I somehow re-enter the
"message pump" (that is, do something that calls
Application.HandleMessage or Application.ProcessMessages) the downloaded
file is corrupted! It took me a while to find this out and now I'm asking:
(1) Wha
Hello Clay,
> Maybe a typo error ?>>
> No, all that code was copied-and-pasted from TCPSrv1.pas.
Maybe you cast the wrong object ?
In a TWSocketSErver event, the Sender argument is TWSocketServer, the
Client argument is your clientclass. In the events of the datasockets
the Sender argument is you
> > I don't know of ANY component where it is safe to call the message pump
from
> > one of its event without knowing what happend. Even for a simple
> > TButton.OnClick, you can get strange result if you call the message pump
> > within the OnClick handler because the handler is re-entered. The
pr
You know, modern hard drives actually checksum written data so you never
get corrupted data back. You might get NO data back (that is, an I/O
error) but that would make any operation on the file fail, including
burning the file to a CD. I've read this in a "howto" for Linux'es
software raid dri
It is actually for data integrity as well (more than security, in my
opinion.) When it comes to large file download, there might be corrupted
bytes. Then this is more likely caused by HD errors then network errors.
>> Conclusion: I think data corruption might be a problem in some cases.
>> Notice
<<> Why would I get EInvalidCast when TcpSrv doesn't, although the cast and
the
> custom class are the same?
Maybe a typo error ?>>
No, all that code was copied-and-pasted from TCPSrv1.pas.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Francois Piette
I can't see a component for Imap in the ICS-package.
I have never used IMAP and don't know much about this protocol, but now have
a customer that needs support for this. Does anyone in this list have any
tip for IMAP-components that works well with ICS?
Regards Bjørnar
--
To unsubscribe or cha
There is nothing to understand in the buffering. The buffer is automatic and
only limited by available virtual memory. You get an exception when you run
out of memory, just like you have - for example - when you run out of memory
trying to add strings to a TStringList or anything else. That is just
Hello Francois,
> IMO, you have all the required tools !
Agree for 100% !
Definitively no need to put wishels and bells into TWSocket !
All the tools are there, this is up to derrived components and or
applications.
---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
ht
Sorry for wrong title in my previous mail ...
- Original Message -
From: "Engi" <[EMAIL PROTECTED]>
To:
Sent: Monday, November 20, 2006 6:22 PM
Subject: [twsocket] How server can send data to clients ?
> Hi,
>
> I have a TWSocketServer which is listening incoming clients connections.
60 matches
Mail list logo