----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <twsocket@elists.org>
Sent: Sunday, May 20, 2007 2:00 PM
Subject: TWSocket Digest, Vol 220, Issue 10
Hello,

Thanks very much for the reply and help.

So i understand...

Assumed the sever is listening...
In tcp proto.

1) connect the client
2) in Client.SessionConnected event : send the string
3) In Client.Datasent event : client.closedelayed

But then for a response
Is this correct ?

1) In server.DataAvailable event : server : ClientServer.sendstring 
response;
2) In Server : ClientServer.Datasent event : 
server.clientserver.closedelayed


balbaro





> Send TWSocket mailing list submissions to
> twsocket@elists.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.elists.org/mailman/listinfo/twsocket
> or, via email, send a message with subject or body 'help' to
> [EMAIL PROTECTED]
>
> You can reach the person managing the list at
> [EMAIL PROTECTED]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of TWSocket digest..."
>
>
> Today's Topics:
>
>   1. Newbie problems with TWSocket. (balbaro)
>   2. Re: Newbie problems with TWSocket. (Francois PIETTE)
>   3. Re: HTTPCli and proxy settings (Dod)
>   4. sending long strings? ([EMAIL PROTECTED])
>   5. Re: Newbie problems with TWSocket. (Wilfried Mestdagh)
>   6. Re: sending long strings? (Wilfried Mestdagh)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 19 May 2007 19:15:25 +0200
> From: balbaro <[EMAIL PROTECTED]>
> Subject: [twsocket] Newbie problems with TWSocket.
> To: twsocket@elists.org
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=us-ascii; format=flowed
>
> Hello all,
>
> I'm puzzled to find out what i'm doing wrong.
>
>
> I made a component with both the TWsocketserver and A TWsocket as client
> to be used in a app.
>
> Server is running.
>
> Can i connect and send a string in the same event ?
>
> For example :
>
> client.connect
>
> wait for state connected
>
> sendstring
>
> close socket
>
>
> Linemode := true and i added the endofline chars to the string.
>
> Is this the correct method ?
>
> Why is the first string always 'Server Ready" ?
>
>
> balbaro
>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 19 May 2007 21:20:33 +0200
> From: "Francois PIETTE" <[EMAIL PROTECTED]>
> Subject: Re: [twsocket] Newbie problems with TWSocket.
> To: "ICS support mailing" <twsocket@elists.org>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
> reply-type=original
>
>> I'm puzzled to find out what i'm doing wrong.
>> I made a component with both the TWsocketserver
>> and A TWsocket as client to be used in a app.
>>
>> Server is running.
>>
>> Can i connect and send a string in the same event ?
>
> No. ICS is asynchronous. Calling Connect is just a reauest to connect. You
> get control back from connect almost i;;ediately while the connection take
> place in the background. When the connection finally establish (or fails
> to), the event OnSessionConnected is triggered. You can start sending from
> that event handler, or later.
>
>> For example :
>> client.connect
>> wait for state connected
>
> You never wait for state connected. You write the code you need to do when
> connected in the OnSessionConnected event hanlder, just like you never 
> wait
> for the user to click on a button but you write the code to be done when 
> the
> button is clicked in the OnClick event handler.
>
>> sendstring
>> close socket
>
> Here again, Send is non blocking. It returns i;;ediately while sending 
> take
> place in the background auto;atically. Data is buffered by TWSocket. When
> buffer has been emptyed, you have OnDataSent event triggered. You can call
> close fro; there, or even better Shutdown to gracefully break the
> connection.
>
>> Linemode := true and i added the endofline chars to the string.
>> Is this the correct method ?
>
> Line:ode only influence receiving: Co;plete lines are assembled before
> triggering OnDataAvailable event. When sending the component send exactly
> what you asked. You have to add yourself the end of line string if you 
> want
> this to be sent.
>
>> Why is the first string always 'Server Ready" ?
>
> Not sure I understand. Please clarify.
>
> [EMAIL PROTECTED]
> The author of the freeware multi-tier middleware MidWare
> The author of the freeware Internet Component Suite (ICS)
> http://www.overbyte.be
>
>
> ------------------------------
>
> Message: 3
> Date: Sun, 20 May 2007 00:46:07 +0200
> From: Dod <[EMAIL PROTECTED]>
> Subject: Re: [twsocket] HTTPCli and proxy settings
> To: ICS support mailing <twsocket@elists.org>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=us-ascii
>
> Hello Arno,
>
> Ouch...true ! I downloaded it 20 dec 2006 but forgot to install it !
>
> regards.
>
>
> AG> Dod wrote:
>>> Hello Arno,
>>>
>>> I don't have OverbyteIcsWinsock2.pas unit in my ICS V6 installation...
>
> AG> Then you are using an old version. The unit also includes a function
> AG> to get systems interface list easily.
>
> AG> --
> AG> Arno Garrels [TeamICS]
> AG> http://www.overbyte.be/eng/overbyte/teamics.html
>
>
>>>
>>> Before  I  need some network oriented function, I usually first try to
>>> look  around  ICS  sources because there are a lot of usefull internal
>>> functions already implemented, FileMD5 or ParseURL are two examples of
>>> functions I was about to do myself that I found inside ICS.
>>>
>>> regards.
>>>
>>> AG> Dod wrote:
>>>>> Next  time i'll see Bill Gates, I'll ask him to implement some
>>>>> Wininet IsLocalAddr function !
>>>
>>> AG> Possibly usefull: ICS v6 function WSocket2IsAddrInSubNet in
>>> OverbyteIcsWinsock2.pas?
>>>
>>> AG> --
>>> AG> Arno Garrels [TeamICS]
>>> AG> http://www.overbyte.be/eng/overbyte/teamics.html
>>>
>>>
>>>
>>>>>
>>>>> regards.
>>>>>
>>>>>
>>>>>>>
>>>>>>> OK  thanks  i'll look at it. My need is very basic as it is only
>>>>>>> to be sure to download a file from specific URL, so no script
>>>>>>> envolved.
>>>>>
>>>>> ML> A script could be involved if "Automatic detect settings" is
>>>>> set, and is ML> involved if "Use automatic configuration script" is
>>>>> set.
>>>>>
>>>>>>> I  think it can be done with regexp (or basic '*' masked string
>>>>>>> search routine) on exception list, getting all IP attached to
>>>>>>> network card(s) (with  netmask) and excluding proxy if IP is
>>>>>>> inside any of the mask of the IP(s).
>>>>>
>>>>> ML> This could work for local addresses.
>>>>> ML> But if you have more than one interface (real NIC, emulated NIC
>>>>> or dial-up) the ML> problem is that you should detect which
>>>>> interface will be used to reach a ML> specific IP, since each dial-
>>>>> up has it own proxy settings while there are only ML> one for the
>>>>> LAN.
>>>>>
>>>>> ML> I never had this situation so I delayed to "solve" it :-)
>>>>>
>>>>>
>>>>> ML> Bye, Maurizio.
>>>>>
>>>>> ML> ----------------------------------------------------
>>>>> ML> This mail has been sent using Alpikom webmail system
>>>>> ML> http://www.alpikom.it
>
>
>
>
> ------------------------------
>
> Message: 4
> Date: Sun, 20 May 2007 00:41:14 -0700
> From: [EMAIL PROTECTED]
> Subject: [twsocket] sending long strings?
> To: twsocket@elists.org
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset="ISO-8859-1"
>
> Hello,
>
>  I have a 2-application client and server that uses TWSocket and
>  TWSocketServer. On the server application, there is a TListView
>  control that contains at least 6 columns. It is used to store
>  information that the user enters, so it could contain a varying number
>  of rows of information at any given time. I need to be able to send
>  all of this information contained in the TListView on the server to
>  the client. Since the TListView control may contain many rows of
>  information - say, 100 or 200 rows - what is the best way to go about
>  sending this to the TWSocket on the client application? Should the
>  rows be appended together into 1 large string and then seperated by
>  the client? Should the rows be sent individually? Or what?
>
>  Thank you!
> -- 
>
>  [EMAIL PROTECTED]
>
> -- 
> http://www.fastmail.fm - The professional email service
>
>
>
> ------------------------------
>
> Message: 5
> Date: Sun, 20 May 2007 09:47:54 +0200
> From: Wilfried Mestdagh <[EMAIL PROTECTED]>
> Subject: Re: [twsocket] Newbie problems with TWSocket.
> To: ICS support mailing <twsocket@elists.org>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=us-ascii
>
> Hello Balbaro,
>
>> Why is the first string always 'Server Ready" ?
>
> Look at the Banner property in TWSocketServer. YOu can set this to ''
> in your code just before you call Listen if you dont want a Banner, or
> you can set your own.
>
> ---
> Rgds, Wilfried [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
> http://www.mestdagh.biz
>
>
>
> ------------------------------
>
> Message: 6
> Date: Sun, 20 May 2007 09:55:45 +0200
> From: Wilfried Mestdagh <[EMAIL PROTECTED]>
> Subject: Re: [twsocket] sending long strings?
> To: ICS support mailing <twsocket@elists.org>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=us-ascii
>
> Hello Entelone,
>
>>   sending this to the TWSocket on the client application? Should the
>>   rows be appended together into 1 large string and then seperated by
>>   the client? Should the rows be sent individually? Or what?
>
> In fact it does not matter. It purely depents on your application and
> what exacly you want to optimize. From TCP point of view the best
> network performance is with a full MTU. That is 1514 bytes minus the TCP
> headers. The Nagle algoritm inside Winsock will therefore, if you send
> smaller packets, wait a while to see if you want to send a next packet,
> so that he can concatenate until a full MTU can be send.
>
> So if you send a packet, and when WSocket has delivered it to Winsock
> and then next packet, then sure mister Nagle will concatenate it. So I
> should do the easy and:
> - Send first line
> - in OnDataSent send next line
>
> A litle protocol is also handy, for example let the receiver know what
> he get (handy for future changes), also how many lines, and where to
> start (handy when connection break).
>
> ---
> Rgds, Wilfried [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html
> http://www.mestdagh.biz
>
>
>
> ------------------------------
>
> _______________________________________________
> 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
>
> End of TWSocket Digest, Vol 220, Issue 10
> ***************************************** 

-- 
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