[fpc-pascal] Sockets in FPC

2009-02-18 Thread Nataraj S Narayan
Hi

I need to write a daemon on Linux which will wait on a user defined
port (say 3) and parse the socket input to write into a Mysql
database. Can anybody suggest examples in FPC ?

Presently , I am using TCL for this. The problem is the behaviour of
Gets function in TCL.. It is buffered with EOF as newline.

But i need the socket to have a user defined char like ':' and it
should be  unbuffered too. I mean dont want an Enter keyed to be at
the end.

We use various GPRS modules on embedded devices, each with its own
nuances of terminating a string. So we can't afford to have a 'normal'
gets or readln behaviours.

Please help


regards

Nataraj
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Sockets in FPC

2009-02-18 Thread Paul Nicholls

Hi

I need to write a daemon on Linux which will wait on a user defined
port (say 3) and parse the socket input to write into a Mysql
database. Can anybody suggest examples in FPC ?

Presently , I am using TCL for this. The problem is the behaviour of
Gets function in TCL.. It is buffered with EOF as newline.

But i need the socket to have a user defined char like ':' and it
should be  unbuffered too. I mean dont want an Enter keyed to be at
the end.

We use various GPRS modules on embedded devices, each with its own
nuances of terminating a string. So we can't afford to have a 'normal'
gets or readln behaviours.

Please help


regards

Nataraj



Hi Nataraj,
   I'm not sure about actual code examples, but you could try the Synapse 
Pascal TCP/IP library classes, they work on Win32, Linux and I'm pretty sure 
MAC OS too :-)


http://www.ararat.cz/synapse/doku.php

cheers,
Paul 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Sockets in FPC

2009-02-18 Thread Lukas Gradl

Nataraj S Narayan schrieb:

Hi

I need to write a daemon on Linux which will wait on a user defined
port (say 3) and parse the socket input to write into a Mysql
database. Can anybody suggest examples in FPC ?

Presently , I am using TCL for this. The problem is the behaviour of
Gets function in TCL.. It is buffered with EOF as newline.

But i need the socket to have a user defined char like ':' and it
should be  unbuffered too. I mean dont want an Enter keyed to be at
the end.

We use various GPRS modules on embedded devices, each with its own
nuances of terminating a string. So we can't afford to have a 'normal'
gets or readln behaviours.


Take a look at synapse and the examples provided with the source and on 
their page. I remember there was a well documented example for a 
ftp-server, which uses exactly the techniques you need for building a 
service.


To daemonize a program on linux there are quite some examples on the net.

regards
Lukas

--

--
software security networks
Lukas Gradl fpc#ssn.at
Eduard-Bodem-Gasse 9
A - 6020 Innsbruck
Tel: +43-512-214040-0
Fax: +43-512-214040-21
--
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal