[fpc-pascal] Designing socket agnostic library

Ludo Brands ludo.brands at free.fr
Tue May 10 11:29:04 CEST 2011


If you want to make a network agnostic api you should define it at a higher
level than you started to do. Something on a stream level. If you need the
lower level socket calls, stick to the standard Berkeley socket API and
don't re-invent the wheel. Fe: listen with port and ip parameter just to get
rid of bind is looking for problems. 
Note also that you have blocking and non blocking socket libraries (some
support both). Your VOIP library will probably change a lot if you use one
or the other blocking mode. Another reason to not make the network
abstraction at that level.

-----Message d'origine-----
De : fpc-pascal-bounces at lists.freepascal.org
[mailto:fpc-pascal-bounces at lists.freepascal.org] De la part de ik
Envoyé : mardi 10 mai 2011 00:30
À : FPC-Pascal users discussions
Objet : [fpc-pascal] Designing socket agnostic library


Hello,

This question is a bit off topic, but not completely. 
I decided to create my own SIP (and other VoIP) library that is open source
(Dual license of both Mozilla and GPL).
I want that the only thing that the library will do is to have
implementation of the VoIP protocols such as SIP, RTP etc.. 
Another reason is that I do not want to create yet another socket library or
a voice/image library, 
only to work on the protocols themselves allowing everyone to choose their
own preferred library to the other tasks.
That way it will be real cross platform library that can be used everywhere
that FPC can be used.

Now the question is how can I create an agnostic API without create a socket
like library skeleton that I'll use in my code, like I started
<https://github.com/ik5/fpVoIP/blob/master/src/lib/sockets/fpsocket_api.pas>
to do already ?

Thanks,
Ido


LINESIP - Opening the source for communication
http://www.linesip.com
http://www.linesip.co.il




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110510/6130b693/attachment.html>


More information about the fpc-pascal mailing list