TCP Server

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

TCP Server

"Fabrício F. Kammer"
Hi all,

I need to developer an application to act as a tcp server that be
compatible with windows/linux (debian).

I want to make a command line application (without graphical interface)
because my linux server don't have the X installed.

I need of an example of how can I make this.

Does someone have an example of a tcp server to send me?

Regards,

Fabrício
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

Amir Aavani-2
Do you tried Indy component? I used them in both graphical and console
application. It is straight forward.
If you need any sample I will be glad

Yours,
Amir

Fabrício F. Kammer wrote:

> Hi all,
>
> I need to developer an application to act as a tcp server that be
> compatible with windows/linux (debian).
>
> I want to make a command line application (without graphical
> interface) because my linux server don't have the X installed.
>
> I need of an example of how can I make this.
>
> Does someone have an example of a tcp server to send me?
>
> Regards,
>
> Fabrício
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

"Fabrício F. Kammer"
Hi Amir,

I tried, but I couldn't install it on my freepascal/lazarus.
Can you help with this installation?

PS: I'm using windows xp

Regards

Fabrício

Amir Aavani escreveu:

> Do you tried Indy component? I used them in both graphical and console
> application. It is straight forward.
> If you need any sample I will be glad
>
> Yours,
> Amir
>
> Fabrício F. Kammer wrote:
>> Hi all,
>>
>> I need to developer an application to act as a tcp server that be
>> compatible with windows/linux (debian).
>>
>> I want to make a command line application (without graphical
>> interface) because my linux server don't have the X installed.
>>
>> I need of an example of how can I make this.
>>
>> Does someone have an example of a tcp server to send me?
>>
>> Regards,
>>
>> Fabrício
>> _______________________________________________
>> fpc-pascal maillist  -  [hidden email]
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

Amir Aavani-2
I Installed on Linux(FC4/5).
I followed the instruction from
http://wiki.lazarus.freepascal.org/index.php/Indy_with_Lazarus.
 with some changes.

Try it!

Fabrício F. Kammer wrote:

> Hi Amir,
>
> I tried, but I couldn't install it on my freepascal/lazarus.
> Can you help with this installation?
>
> PS: I'm using windows xp
>
> Regards
>
> Fabrício
>
> Amir Aavani escreveu:
>> Do you tried Indy component? I used them in both graphical and
>> console application. It is straight forward.
>> If you need any sample I will be glad
>>
>> Yours,
>> Amir
>>
>> Fabrício F. Kammer wrote:
>>> Hi all,
>>>
>>> I need to developer an application to act as a tcp server that be
>>> compatible with windows/linux (debian).
>>>
>>> I want to make a command line application (without graphical
>>> interface) because my linux server don't have the X installed.
>>>
>>> I need of an example of how can I make this.
>>>
>>> Does someone have an example of a tcp server to send me?
>>>
>>> Regards,
>>>
>>> Fabrício
>>> _______________________________________________
>>> fpc-pascal maillist  -  [hidden email]
>>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>
>>
>> _______________________________________________
>> fpc-pascal maillist  -  [hidden email]
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

"Fabrício F. Kammer"
Thanks Amir, I saw this, but I don't have the packets bellow on the Indy
10 installation :(

     *  Open and compile indysystemlaz.lpk
     * Open and compile indycorelaz.lpk
     * Open and compile indyprotocolslaz.lpk
     * Open, compile and install dclindycorelaz.lpk
     * Open, compile and install dclindyprotocolslaz.lpk

How do you do to install without the packets?

Amir Aavani escreveu:

> I Installed on Linux(FC4/5).
> I followed the instruction from
> http://wiki.lazarus.freepascal.org/index.php/Indy_with_Lazarus.
> with some changes.
>
> Try it!
>
> Fabrício F. Kammer wrote:
>> Hi Amir,
>>
>> I tried, but I couldn't install it on my freepascal/lazarus.
>> Can you help with this installation?
>>
>> PS: I'm using windows xp
>>
>> Regards
>>
>> Fabrício
>>
>> Amir Aavani escreveu:
>>> Do you tried Indy component? I used them in both graphical and
>>> console application. It is straight forward.
>>> If you need any sample I will be glad
>>>
>>> Yours,
>>> Amir
>>>
>>> Fabrício F. Kammer wrote:
>>>> Hi all,
>>>>
>>>> I need to developer an application to act as a tcp server that be
>>>> compatible with windows/linux (debian).
>>>>
>>>> I want to make a command line application (without graphical
>>>> interface) because my linux server don't have the X installed.
>>>>
>>>> I need of an example of how can I make this.
>>>>
>>>> Does someone have an example of a tcp server to send me?
>>>>
>>>> Regards,
>>>>
>>>> Fabrício
>>>> _______________________________________________
>>>> fpc-pascal maillist  -  [hidden email]
>>>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>>
>>>
>>> _______________________________________________
>>> fpc-pascal maillist  -  [hidden email]
>>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>> _______________________________________________
>> fpc-pascal maillist  -  [hidden email]
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

Lukas Gebauer
In reply to this post by "Fabrício F. Kammer"
> I need to developer an application to act as a tcp server that be
> compatible with windows/linux (debian).
>
> I want to make a command line application (without graphical
> interface) because my linux server don't have the X installed.

Why not Synapse? You must not install Synapse into your Lazarus,
because it is just set of units with set of classes and functions.
Just include unit in 'uses'...

Sample for simple TCP server is included in demo. (it implementing
simple echo)

Latest snapshot of Synapse needs FPC 2.0.4 and it using native
Freepascals units for socket communication - you can use it on any
linux/unix platform. (and, of course, on Windows platform too)



--
Lukas Gebauer.

E-mail: [hidden email]
http://synapse.ararat.cz/ - Ararat Synapse - TCP/IP Lib.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

Marco van de Voort
In reply to this post by "Fabrício F. Kammer"
> Thanks Amir, I saw this, but I don't have the packets bellow on the Indy
> 10 installation :(
>
>      *  Open and compile indysystemlaz.lpk
>      * Open and compile indycorelaz.lpk
>      * Open and compile indyprotocolslaz.lpk
>      * Open, compile and install dclindycorelaz.lpk
>      * Open, compile and install dclindyprotocolslaz.lpk
>
> How do you do to install without the packets?

I believe a simple make in the directory builds the libs+ demoes.

Then run make info as root to check where it installs. (root or not
influences the info)

If Ok then run make install as root.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

Adrian Veith
In reply to this post by "Fabrício F. Kammer"
Use Synapse instead of Indy.  After I have found Synapse, I dumped Indy.

goto http://www.ararat.cz/synapse/

Lukas has done a very fine tool !!

Cheers, Adrian.

Fabrício F. Kammer schrieb:

> Hi all,
>
> I need to developer an application to act as a tcp server that be
> compatible with windows/linux (debian).
>
> I want to make a command line application (without graphical
> interface) because my linux server don't have the X installed.
>
> I need of an example of how can I make this.
>
> Does someone have an example of a tcp server to send me?
>
> Regards,
>
> Fabrício
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

"Fabrício F. Kammer"
OK,

I downloaded the synapse, but I don't know how to use it to make a TCP
server.

I need to do a server that listen on a specific port. After connected
the client will send some commands to the server that will make some
actions and return the results to the client.

Basicly the client will send strings to the server and receive another
strings.

[]s

Fabrício

Adrian Veith escreveu:

> Use Synapse instead of Indy.  After I have found Synapse, I dumped Indy.
>
> goto http://www.ararat.cz/synapse/
>
> Lukas has done a very fine tool !!
>
> Cheers, Adrian.
>
> Fabrício F. Kammer schrieb:
>> Hi all,
>>
>> I need to developer an application to act as a tcp server that be
>> compatible with windows/linux (debian).
>>
>> I want to make a command line application (without graphical
>> interface) because my linux server don't have the X installed.
>>
>> I need of an example of how can I make this.
>>
>> Does someone have an example of a tcp server to send me?
>>
>> Regards,
>>
>> Fabrício
>> _______________________________________________
>> fpc-pascal maillist  -  [hidden email]
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

Aleksey Y. Ulasevich (STAKANOV)

>
> I downloaded the synapse, but I don't know how to use it to make a TCP
> server.
>
> I need to do a server that listen on a specific port. After connected the
> client will send some commands to the server that will make some actions
> and return the results to the client.
>
> Basicly the client will send strings to the server and receive another
> strings.

Why synapse? Why indy? You may use fpc unit "sockets" for it.
For more information see standard fpc documentation -
http://www.freepascal.org/docs-html/rtl/sockets/index.html

Some examples in http://www.freepascal.org/docs-html/rtl/sockets/accept.html 
, http://www.freepascal.org/docs-html/rtl/sockets/connect.html ... and
others.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

Amir Aavani-2
In reply to this post by "Fabrício F. Kammer"
They are in Lib folder. I myself once tried the synapse but I could not
figure it out.
What you want to do is not a hard one, I have written some programs in
this style all using Indy.
 >> Why indy? You may use fpc unit "sockets" for it.
May be because of OOP (at least about Indy).

> Thanks Amir, I saw this, but I don't have the packets bellow on the
> Indy 10 installation :(
>
>     *  Open and compile indysystemlaz.lpk
>     * Open and compile indycorelaz.lpk
>     * Open and compile indyprotocolslaz.lpk
>     * Open, compile and install dclindycorelaz.lpk
>     * Open, compile and install dclindyprotocolslaz.lpk
>
> How do you do to install without the packets?
>
> Amir Aavani escreveu:
>> I Installed on Linux(FC4/5).
>> I followed the instruction from
>> http://wiki.lazarus.freepascal.org/index.php/Indy_with_Lazarus.
>> with some changes.
>>
>> Try it!
>>
>> Fabrício F. Kammer wrote:
>>> Hi Amir,
>>>
>>> I tried, but I couldn't install it on my freepascal/lazarus.
>>> Can you help with this installation?
>>>
>>> PS: I'm using windows xp
>>>
>>> Regards
>>>
>>> Fabrício
>>>
>>> Amir Aavani escreveu:
>>>> Do you tried Indy component? I used them in both graphical and
>>>> console application. It is straight forward.
>>>> If you need any sample I will be glad
>>>>
>>>> Yours,
>>>> Amir
>>>>
>>>> Fabrício F. Kammer wrote:
>>>>> Hi all,
>>>>>
>>>>> I need to developer an application to act as a tcp server that be
>>>>> compatible with windows/linux (debian).
>>>>>
>>>>> I want to make a command line application (without graphical
>>>>> interface) because my linux server don't have the X installed.
>>>>>
>>>>> I need of an example of how can I make this.
>>>>>
>>>>> Does someone have an example of a tcp server to send me?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Fabrício
>>>>> _______________________________________________
>>>>> fpc-pascal maillist  -  [hidden email]
>>>>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>>>
>>>>
>>>> _______________________________________________
>>>> fpc-pascal maillist  -  [hidden email]
>>>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>> _______________________________________________
>>> fpc-pascal maillist  -  [hidden email]
>>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>>
>>
>> _______________________________________________
>> fpc-pascal maillist  -  [hidden email]
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

Andreas Berger
In reply to this post by "Fabrício F. Kammer"

> OK,
>
> I downloaded the synapse, but I don't know how to use it to make a TCP
> server.
>
> I need to do a server that listen on a specific port. After connected
> the client will send some commands to the server that will make some
> actions and return the results to the client.
>
> Basicly the client will send strings to the server and receive another
> strings.
Check out the echo demo in synapse. It seem to be exactly what you want.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

"Fabrício F. Kammer"
OK I was able to run the echo server example. Now I need to know how can
I make a server that gets the commands sends by my client application
and make the right actions with these commands.

Can anyone help with this?

PS: I'm trying to install the indy on windows xp without succes, if
someone can help me I'll be thanks.

[]s

Fabrício

Andreas Berger escreveu:

>
>> OK,
>>
>> I downloaded the synapse, but I don't know how to use it to make a TCP
>> server.
>>
>> I need to do a server that listen on a specific port. After connected
>> the client will send some commands to the server that will make some
>> actions and return the results to the client.
>>
>> Basicly the client will send strings to the server and receive another
>> strings.
> Check out the echo demo in synapse. It seem to be exactly what you want.
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: TCP Server

Adrian Veith
Hello Fabricio,

there are some examples at the synapse wiki page. I suggest that you
also subscribe to the synalist at sourceforge.net - this is the right
place to ask questions about synapse. There are many active users which
can answer your questions.

Anyway, if you have the echo server running, than you have "almost" done
the job. Instead of echoing the the data back to the client, you have to
analyze the commands and send the results back to client.

Cheers,

Adrian.

Fabrício F. Kammer schrieb:

> OK I was able to run the echo server example. Now I need to know how
> can I make a server that gets the commands sends by my client
> application and make the right actions with these commands.
>
> Can anyone help with this?
>
> PS: I'm trying to install the indy on windows xp without succes, if
> someone can help me I'll be thanks.
>
> []s
>
> Fabrício
>
> Andreas Berger escreveu:
>>
>>> OK,
>>>
>>> I downloaded the synapse, but I don't know how to use it to make a
>>> TCP server.
>>>
>>> I need to do a server that listen on a specific port. After
>>> connected the client will send some commands to the server that will
>>> make some actions and return the results to the client.
>>>
>>> Basicly the client will send strings to the server and receive
>>> another strings.
>> Check out the echo demo in synapse. It seem to be exactly what you want.
>>
>> _______________________________________________
>> fpc-pascal maillist  -  [hidden email]
>> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal