Re: [twsocket] Newbie problems with TWSocket. (balbaro)

2007-05-20 Thread Wilfried Mestdagh
Hello Balbaro,

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

No. This will not garantie that the data is arrived by the server. You
can make a protocol for it, so that the server send back ACK after it
has handled the data. Then close the connection. You can also call
Shutdown(1). This will send a close request to the other end. The close
request will arrive after the data of course, then the other end can
close it.

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

You only have to close 1 side of the connection. The other side will
close also. Again OnDataSent is not at arrival time, it is fired when
TWSocket has given all data to winsock. As said you can use Shutdown(1)
but only at one end, that is the end that sends the last time and does
not expect a responce anymore.

Also a proto is easy to implement. If you have ascii data you can make
the proto in ascii as whell using LineEnd. But I dont know your
application of course.

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


Re: [twsocket] Newbie problems with TWSocket. (balbaro)

2007-05-20 Thread Francois PIETTE
 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

It depends on the protocol you are designing.
Most protocols in use (FTP, SMTP, POP3 and more) are line oriented and use a 
command/response scheme:
1. The client connect
2. the sender send his welcome banner
3. the client send a command
4. the server send his reply
5. goto step 3 until client send hist quit command for which the server 
gracefuly close the connection.

--
[EMAIL PROTECTED]
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be
-- 
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