[twsocket] Connection catch-22

2006-11-16 Thread Clay Shannon
uot; if iSent > 0 then begin Inc(Ptr, iSent); Dec(iSize, iSent); Continue; end; if iSent = 0 then begin ClientSocket.Close; raise Exception.Create('Connection closed gracefully'); end; iErrorCode := WSAGetLastError; if iError

[twsocket] Shutdown(How: Integer)

2006-11-17 Thread Clay Shannon
When do I need, or would I want, to call Shutdown(), and what are the ramifications of the different parameters that one can pass it. I see Shutdown(2) in one of the demo apps, but don't know what "2" represents. The information transmitted is intended only for the person or entity to which it

[twsocket] Need example code for identifying a record before processing

2006-11-17 Thread Clay Shannon
I will be receiving a variety of structs/records, all of different sizes and "makeups". How can I (in the OnDataAvailable() handler, I assume), determine/identify which record has just come in, so that I can process it accordingly? OnDataAvailable() should only fire once for each record, b

[twsocket] Pulling my hair out trying to receive a record

2006-11-17 Thread Clay Shannon
I am trying to test sending records from a utility to my app, which should receive and process the records. I am able to send the record from my test utility with this code: procedure TForm10.btnSendMsgAsRecordClick(Sender: TObject); begin InitializeWSocketProperties; WSocket_AsClien

Re: [twsocket] Need example code for identifying a recordbeforeprocessing

2006-11-21 Thread Clay Shannon
<< 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

Re: [twsocket] Need example code foridentifyingarecordbeforeprocessing

2006-11-21 Thread Clay Shannon
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

Re: [twsocket] Need example code for identifyingarecordbeforeprocessing

2006-11-21 Thread Clay Shannon
<< 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

Re: [twsocket] Which TWSocketServer event to capture data sent?

2006-11-21 Thread Clay Shannon
.ClientClass := TTcpSrvClient; { Use our component } WSocketServer.Listen; <-- here end; Before WSocketServer1ClientConnect() is even reached. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Clay Shannon Sent: Monday, Novembe

Re: [twsocket] Need example code for identifying a recordbeforeprocessing

2006-11-21 Thread Clay Shannon
<<> 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

Re: [twsocket] Which TWSocketServer event to capture data sent?

2006-11-21 Thread Clay Shannon
<<> 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

[twsocket] Still "rassling" with sending and receiving

2006-11-21 Thread Clay Shannon
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

Re: [twsocket] Which TWSocketServer event to capture data sent?

2006-11-21 Thread Clay Shannon
<< 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

[twsocket] Which TWSocketServer event to capture data sent?

2006-11-21 Thread Clay Shannon
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

Re: [twsocket] Pulling my hair out trying to receive a record

2006-11-21 Thread Clay Shannon
he housekeeping needed to handle simultaneous clients. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: "Clay Shannon" <[EMAIL PROTECTED]> To: "'ICS support mailing&#x

[twsocket] Overview of TICSLogger?

2006-11-21 Thread Clay Shannon
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

Re: [twsocket] Which TWSocketServer event to capture data sent?

2006-11-21 Thread Clay Shannon
<< 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

Re: [twsocket] Still "rassling" with sending and receiving

2006-11-21 Thread Clay Shannon
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Clay Shannon Sent: Tuesday, November 21, 2006 9:55 AM To: 'ICS support mailing' Subject: [twsocket] Still "rassling" with sending and receiving When I send a string from my test utility, the ClientConnect() even

Re: [twsocket] Posting datatoweb serverusing THttpCliunder usercontrol

2006-11-22 Thread Clay Shannon
<<> Do you see any wholes in my logic? I don't.>> Partials? 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 reader of this message is not the intended recipient, you are hereby notifie

Re: [twsocket] Still "rassling" with sending and receiving

2006-11-22 Thread Clay Shannon
Right now, though, it's working TOO good My ClientDataAvailable() procedure (assigned to my TWSocketServer's OnDataAvailable() event as shown below) is firing twice--for every message I send my app from my test utility, ClientDataAvailable() gets fired twice! procedure TfClientMain.WSocketServer

Re: [twsocket] Still "rassling" with sending and receiving

2006-11-22 Thread Clay Shannon
iling lists as to snipping previous parts of the thread--should I cut out everything below this, or leave it be (leaving it be until I hear/read otherwise). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Clay Shannon Sent: Wednesday, November 22, 2006

Re: [twsocket] Still "rassling" with sending and receiving

2006-11-22 Thread Clay Shannon
<> And to add to the mystery, or provide a clue, in the first instance the string message sent has a #$D appended, but in the second case it doesn't... The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged mat

Re: [twsocket] Still "rassling" with sending and receiving

2006-11-22 Thread Clay Shannon
My bad! I fixed it by moving the line to process the msg outside of the "strip out the carriage return and line feed" loop: Was: procedure TfClientMain.ClientDataAvailable(Sender: TObject; Error: Word); var iMsgCode, iMsgTableID: Integer; begin with Sender as TTcpSrvClient do begin { Sinc

Re: [twsocket] TCP stack problems 2003

2006-11-27 Thread Clay Shannon
<> Where's the beef? 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 reader of this message is not the intended recipient, you are hereby notified that your access is unauthorized, and

Re: [twsocket] Error 10058 when not sending?

2006-11-28 Thread Clay Shannon
<> FWIW: WSAESHUTDOWN 10058 Cannot send after socket shutdown 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 reader of this message is not the intended recipient, you are he

Re: [twsocket] Freeze when using smtp after recreating itsparentform

2006-12-12 Thread Clay Shannon
<> It sounds like you have a toilet hooked up to your computer. 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 reader of this message is not the intended recipient, you are hereby not

[twsocket] Testing messages sent from client to server app

2007-03-28 Thread Clay Shannon
Hello again (after a long absence). I am using Delphi 2006 and the ICS TWSocket and TWSocketServer components, in a MIDAS app. Is it possible to send messages from my client app to my server app on the same machine (they are both running on the same machine during development/testing)? I would

Re: [twsocket] Testing messages sent from client to server app

2007-03-28 Thread Clay Shannon
Arno, <> Thanks, that works just fine. I am now adding the messages to a stringList in the method above, and then calling ICS_SendString() in the SessionConnected() event, looping through the stringlist and then deleting all of its items afterwards. <> Directly in the DFM: Procedure TfJCPServ

Re: [twsocket] Testing messages sent from client to server app

2007-03-29 Thread Clay Shannon
AM To: ICS support mailing Subject: Re: [twsocket] Testing messages sent from client to server app Clay Shannon wrote: >> BTW, didn't you have something to do with "Alice's Restaurant"? I don't think so, when the movie came out in the late sixties I still was a

[twsocket] Messages being sent, but Client app locking up

2007-03-29 Thread Clay Shannon
I am successfully sending messages from my Client MIDAS app to my Server MIDAS app, but then the Client app locks up. Here is my code: 1) The user (me) presses a button to send a message: { This is a test } procedure TfClientMain.Button1Click(Sender: TObject); begin SendMessageToRealTime(1, Fo

Re: [twsocket] Messages being sent, but Client app locking up

2007-03-29 Thread Clay Shannon
Oops, I left out a part: { Called by SendMessageToRealTime() } procedure TfClientMain.ICS_SendString(AMessageToSend: String); begin try ICSSocket_Sending.SendStr(AMessageToSend); except on E: Exception do begin ShowMessage(Format('%s: %s', [E.ClassName, E.Message])); Client

Re: [twsocket] Messages being sent, but Client app locking up

2007-03-29 Thread Clay Shannon
Adding ICSSocket_Sending.Close as shown below solves the lockup problem: for i := Pred(slMessagesToSend.Count) downto 0 do slMessagesToSend.Delete(i); ICSSocket_Sending.Close; //Voila! The information transmitted is intended only for the person or entity to which it is addressed and may c

Re: [twsocket] Messages being sent, but Client app locking up

2007-03-30 Thread Clay Shannon
<> The app became totally unresponsive. As mentioned in an earlier post, I think, though, I fixed it by calling TWSocket's Close() method. 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 th

Re: [twsocket] Messages being sent, but Client app locking up

2007-04-03 Thread Clay Shannon
<> Yes << and if yes, do you receive always all data ?>> >> I think so -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilfried Mestdagh Sent: Saturday, March 31, 2007 2:30 AM To: ICS support mailing Subject: Re: [twsocket] Messages being sent, but Clie

[twsocket] How to download (ftp) an entire directory (best way)

2006-08-15 Thread Clay Shannon
Hello all (I'm new to the list, and this is my first post). Is the following the way to download (via ftp) the contents of an entire directory? IOW, providing the HostDirName but no HostFileName? Or...? I'm also open to suggestion on better ways to do this, such as removing unnecessary

[twsocket] Must explicitly start winsocks, or...?

2006-08-15 Thread Clay Shannon
Running the ftptst app in D2006, and pressing the "Open" button, I get a timeout error: Winsock version 2.2 WinSock 2.0 Running Executing Requested Command Request 1 Done. StatusCode = 500 LastResponse was : '500 Connection timed out (Winsock error #10060)' Error = 10060 (500 Connection

[twsocket] ftp sample code?

2006-08-21 Thread Clay Shannon
;d like to share? Alternatively, does anybody know how to do this in a more general sense? Clay Shannon 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 reader of this message is not th

[twsocket] List() method?

2006-08-21 Thread Clay Shannon
In the TFTPClient Quick Reference I find the following: . Methods: . List - Connect, Cwd, Download a file name listing to a file & Quit . I would expect this method to take at least two arguments (directory name and file name). How does one set these values?

Re: [twsocket] List() method?

2006-08-21 Thread Clay Shannon
<< The List argument is taken for HostFileName. What is done with the argument is totally under server's control.>> But I'm trying to retrieve a list of filenames from the ftp server, not just one "HostFileName." And there is no file on the server that contains a listing of files itself (such as a

Re: [twsocket] List() method?

2006-08-21 Thread Clay Shannon
<> Thanks, but what I still don't see is how I can direct the ftp'd files to be placed on my local machine. IOW, I know can direct the listing via the List() method to be written to the value I assign to the LocalFileName property, but when I loop through the file names listed in that file, how do

Re: [twsocket] List() method?

2006-08-21 Thread Clay Shannon
<< The answer lies in your code :) ICSFTP.LocalFileName := 'C:\Misc\FilesInHostDir.txt'; <--- Whener you do a "Get()", this is the place to look for the downloaded files.>> So does this change look right: Old code: for i := 0 to Pred(sl.Count) do if IsAWantedFile(sl[i]) then b