BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is there such a framework ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Andreas Koch
Guest





PostPosted: Sat Sep 17, 2005 9:24 am    Post subject: Is there such a framework ? Reply with quote



Hi all,

i thought about writing an tcp/ip framework component
to encapsule all the code i usually need to actually
USE tcp/ip sockets, in a clean way.

Of course before i re-invent the wheel, i'd like
to ask if someone allready knows existing free
opensource solutions for that?

Current planning state:

a Component TNetwork

Properties
Serverlist:TStrings;
port:integer;
username:string;

UsersConnected:TStrings;
Data:TDataPacketList;

Methods
SendTo(ToUser:String;var data;length:integer);
SendTo(ToUser:String;TStream data;length:integer);

Events:
DataAvailable

Class TDataPacket
Data:TStream;
Sender:String;
end;


If the component goes active, it will search the server list
top-down for an active server. If one is found, it connects.
If none is found, it becomes an active server itself.

Data can be send to one, multiple (,-separated), or all users.
If the server goes offline, one of the clients will be made
new server.

When using TNetwork:
-you don't have to worry about if your app is client or server
-sending is non-blocking
-recieving is event-based
-a send block will allways be recieved as one DataPacket - no
event before the transmission is complete
-connects/disconnects are handled automatically
-you don't have to keep your own user/connection/socket lists
-you don't need dedicated servers

Is there allready some (free, opensource) framework that does
something similar like the above?

thanks a lot,
Andreas
Back to top
Francois PIETTE [ICS - Mi
Guest





PostPosted: Sat Sep 17, 2005 10:15 am    Post subject: Re: Is there such a framework ? Reply with quote



Quote:
i thought about writing an tcp/ip framework component
to encapsule all the code i usually need to actually
USE tcp/ip sockets, in a clean way.

Of course before i re-invent the wheel, i'd like
to ask if someone allready knows existing free
opensource solutions for that?

There is: Internet Component Suite (ICS) among others. ICS is freewrae with
full source code. You can download it from http://www.overbyte.be (It is
also on Delphi Companion CD delivered with Delphi 5, 6, 7, 8, 2K5 and Kylix
1/2/3 and BCB 5/6. But the version on the website has been updated). ICS is
a fully asynchronous event driven component set.

Quote:
If the component goes active, it will search the server list
top-down for an active server. If one is found, it connects.
If none is found, it becomes an active server itself.

Well, maybe there you are confusing TCP/IP with applications using TCP/IP as
transport. Most TCP/IP protocols has no way to discover available server,
except trying to connect to it. Windows networking has functions to
enumerate servers, but this has really nothing to do with TCP/IP.

Quote:
Data can be send to one, multiple (,-separated), or all users.

That is singlecast, multicast and broadcast. Only available with UDP
protocol.

Quote:
If the server goes offline, one of the clients will be made
new server.

???

Quote:
When using TNetwork:
-you don't have to worry about if your app is client or server

Of course you have. Server is the one passively waiting for client
connection. Client is the one which takes the initiative to connect. Server
has to manage a list of all client actually connected.

Quote:
-sending is non-blocking

ICS works like that. It has an internal dynamic buffer to hold data sent
until it can really be sent at the speed the remote peer accept it.

Quote:
-recieving is event-based

ICS works like that. ICS has an OnDataAvailable event that is triggered when
a packet has arrived. It can also work in "line mode" and assemble packets
into lines, and trigger one OnDataAvailable event for each complete line, no
matter if a line is split into several packets or one packet contains
several lines. A lines is defined as a byte stream terminated by an end of
line string you can select yourself and which default to CR/LF pair.

Quote:
-a send block will allways be recieved as one DataPacket - no
event before the transmission is complete

That is only possible with UDP. TCP is a stream protocol that doesn't
preserve datagram boundaries. Small packets can be merged into larger one
and large packet can be split into smaller packets. Your software has to
manage with this behaviour (ICS line mode make this behaviour transparent).

Quote:
-connects/disconnects are handled automatically

ICS works like that. When you ask to connect, the component give control
back immediateley (non-blocking) while connection will take place in the
background. When the connection is established, you get an
OnSessionConnected event. If the connection can't be established, you also
get an OnSessionConnected event with and error argument telling you why
connection failed. When session is disconnected, by either peer, you get an
OnSessionClosed event.

Quote:
-you don't have to keep your own user/connection/socket lists

ICS server socket handle that for you.

Quote:
-you don't need dedicated servers

This is not related to TCP/IP but the way applications, OS and computer are
organized.

Quote:
Is there allready some (free, opensource) framework that does
something similar like the above?

Yes, ICS does it and does many more things.
Download from http://www.overbyte.be

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[email]francois.piette (AT) overbyte (DOT) be[/email]
The author for the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be





Back to top
Andreas Koch
Guest





PostPosted: Sat Sep 17, 2005 12:10 pm    Post subject: Re: Is there such a framework ? Reply with quote



Hi Francios,

thanks for your answers. I guess i wasn't precise enough.
I do NOT look "just" for good TCP/IP components.

I look for a framework that allows me to send data
between several instances of my app that run on
several computers, without having to handle any of
the TCP/IP-details myself (other than specifying the
IP addresses/network names of the partipicants).

Quote:
If the component goes active, it will search the server list
top-down for an active server. If one is found, it connects.
If none is found, it becomes an active server itself.

Well, maybe there you are confusing TCP/IP with applications using TCP/IP as
transport. Most TCP/IP protocols has no way to discover available server,
except trying to connect to it. Windows networking has functions to
enumerate servers, but this has really nothing to do with TCP/IP.

Yes, thats why i want to specify the servers addresses in a property
of the compoment. It should then try to connect to the first, and
if it can't connect, try the next one.

Quote:
Data can be send to one, multiple (,-separated), or all users.

That is singlecast, multicast and broadcast. Only available with UDP
protocol.

I don't want to do a cast on TCP/IP level.
The client should send data via TCP/IP to the server, containing
the target address. The server will forward the data to the
addressed clients. This addressing is all done inside the
TCP/IP data, not on IP-Address level.

Quote:
If the server goes offline, one of the clients will be made
new server.

???

The server chooses one client, tells it to become a server,
and tells the other clients to re-connect to that new server.

Quote:
-you don't have to worry about if your app is client or server
Of course you have. Server is the one passively waiting for client
connection. Client is the one which takes the initiative to connect. Server
has to manage a list of all client actually connected.

Yes. And the TNetwork component should handle that itself, so i
don't have to care if it currently acts as a client or as a server
when using it.

Quote:
-a send block will allways be recieved as one DataPacket - no
event before the transmission is complete

That is only possible with UDP. TCP is a stream protocol that doesn't
preserve datagram boundaries. Small packets can be merged into larger one
and large packet can be split into smaller packets. Your software has to
manage with this behaviour (ICS line mode make this behaviour transparent).

Yes, that is why i want a TNetwork component that adds an level
of abstraction to the TCP/IP protocoll and does things like
"managing this behaviour".


Quote:
-connects/disconnects are handled automatically

ICS works like that. When you ask to connect, the component give control
back immediateley (non-blocking) while connection will take place in the
background.

I more wanted to say, if i send data, TNetWork automatically finds
a suitable server and connects to it, and connects to the new server
if the old server goes offline.


Back to top
Francois PIETTE [ICS - Mi
Guest





PostPosted: Sat Sep 17, 2005 2:34 pm    Post subject: Re: Is there such a framework ? Reply with quote

Quote:
I look for a framework that allows me to send data
between several instances of my app that run on
several computers, without having to handle any of
the TCP/IP-details myself (other than specifying the
IP addresses/network names of the partipicants).

This is simply a new TCP (or UDP) protocol of your own. You may implement
this protocol with ICS (or other socket component). IMO it is just a thin
layer above TCP or UDP. And you already have some similar protocols built
into windows: named pipes (TCP) and mailslots (UDP).

The details you are talking about are almost all already implemented in ICS
(TWSocket and TWSocketServer). Only server discovery has to be implemented
(it is frequently a security hole because hackers may discover what you have
in your network).

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[email]francois.piette (AT) overbyte (DOT) be[/email]
The author for the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be



"Andreas Koch" <nospam (AT) kochandreas (DOT) com> a écrit dans le message de news:
[email]432c0754 (AT) newsgroups (DOT) borland.com[/email]...
Quote:
Hi Francios,

thanks for your answers. I guess i wasn't precise enough.
I do NOT look "just" for good TCP/IP components.

I look for a framework that allows me to send data
between several instances of my app that run on
several computers, without having to handle any of
the TCP/IP-details myself (other than specifying the
IP addresses/network names of the partipicants).

If the component goes active, it will search the server list
top-down for an active server. If one is found, it connects.
If none is found, it becomes an active server itself.

Well, maybe there you are confusing TCP/IP with applications using TCP/IP
as transport. Most TCP/IP protocols has no way to discover available
server, except trying to connect to it. Windows networking has functions
to enumerate servers, but this has really nothing to do with TCP/IP.

Yes, thats why i want to specify the servers addresses in a property
of the compoment. It should then try to connect to the first, and
if it can't connect, try the next one.

Data can be send to one, multiple (,-separated), or all users.

That is singlecast, multicast and broadcast. Only available with UDP
protocol.

I don't want to do a cast on TCP/IP level.
The client should send data via TCP/IP to the server, containing
the target address. The server will forward the data to the
addressed clients. This addressing is all done inside the
TCP/IP data, not on IP-Address level.

If the server goes offline, one of the clients will be made
new server.

???

The server chooses one client, tells it to become a server,
and tells the other clients to re-connect to that new server.

-you don't have to worry about if your app is client or server
Of course you have. Server is the one passively waiting for client
connection. Client is the one which takes the initiative to connect.
Server has to manage a list of all client actually connected.

Yes. And the TNetwork component should handle that itself, so i
don't have to care if it currently acts as a client or as a server
when using it.

-a send block will allways be recieved as one DataPacket - no
event before the transmission is complete

That is only possible with UDP. TCP is a stream protocol that doesn't
preserve datagram boundaries. Small packets can be merged into larger one
and large packet can be split into smaller packets. Your software has to
manage with this behaviour (ICS line mode make this behaviour
transparent).

Yes, that is why i want a TNetwork component that adds an level
of abstraction to the TCP/IP protocoll and does things like
"managing this behaviour".


-connects/disconnects are handled automatically

ICS works like that. When you ask to connect, the component give control
back immediateley (non-blocking) while connection will take place in the
background.

I more wanted to say, if i send data, TNetWork automatically finds
a suitable server and connects to it, and connects to the new server
if the old server goes offline.




Back to top
Andreas Koch
Guest





PostPosted: Sat Sep 17, 2005 4:59 pm    Post subject: Re: Is there such a framework ? Reply with quote

Francois PIETTE [ICS - MidWare] wrote:
Quote:
I look for a framework that allows me to send data
between several instances of my app that run on
several computers, without having to handle any of
the TCP/IP-details myself (other than specifying the
IP addresses/network names of the partipicants).


This is simply a new TCP (or UDP) protocol of your own. You may implement
this protocol with ICS (or other socket component).

Ehm yes. And i'm looking for a framework that allready implements
such a protocol - but from your answers, i guess that sort of task
isn't common enough to have a few allready floating arround.

Ok, should be a matter of a few hours to build one :-)


Back to top
Francois PIETTE [ICS - Mi
Guest





PostPosted: Sat Sep 17, 2005 7:36 pm    Post subject: Re: Is there such a framework ? Reply with quote

Quote:
I look for a framework that allows me to send data
between several instances of my app that run on
several computers, without having to handle any of
the TCP/IP-details myself (other than specifying the
IP addresses/network names of the partipicants).


This is simply a new TCP (or UDP) protocol of your own. You may implement
this protocol with ICS (or other socket component).

Ehm yes. And i'm looking for a framework that allready implements
such a protocol - but from your answers, i guess that sort of task
isn't common enough to have a few allready floating arround.

IMO, you can't do much more than what almost any TCP socket component
already do. You will just add another layer that would probably only slow
down the process.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[email]francois.piette (AT) overbyte (DOT) be[/email]
The author for the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.