Recent

Author Topic: can i make server?  (Read 68302 times)

shs

  • Sr. Member
  • ****
  • Posts: 310
can i make server?
« on: October 16, 2017, 10:02:19 am »
can i make server?

rvk

  • Hero Member
  • *****
  • Posts: 6112
Re: can i make server?
« Reply #1 on: October 16, 2017, 10:05:12 am »
Yes, you can.

shs

  • Sr. Member
  • ****
  • Posts: 310
Re: can i make server?
« Reply #2 on: October 16, 2017, 10:55:26 am »
On lazarus? can you please teach me how? is it possible to make server for messaging?

rvk

  • Hero Member
  • *****
  • Posts: 6112
Re: can i make server?
« Reply #3 on: October 16, 2017, 11:07:14 am »
Didn't you say you would Google for it before you asked a question here ??
http://forum.lazarus.freepascal.org/index.php/topic,38136.msg262316.html#msg262316

So Google for Lazarus server and you'll find plenty of examples.
What did you find?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: can i make server?
« Reply #4 on: October 16, 2017, 11:08:19 am »
On lazarus? can you please teach me how? is it possible to make server for messaging?
What protocol? On top of what layer? TCP? HTTP? It's important to know what you want to build before start building it.

shs

  • Sr. Member
  • ****
  • Posts: 310
Re: can i make server?
« Reply #5 on: October 16, 2017, 11:31:25 am »
i googled it but most of them are talking about http which is website right? but i want to make a server in the program(i don't if that is possible). and i clicked some of the examples but i don't understand anything on there so yeh..

@leledumbo
um not http so i guess it's tcp?

rvk

  • Hero Member
  • *****
  • Posts: 6112
Re: can i make server?
« Reply #6 on: October 16, 2017, 11:59:08 am »
Here is a simple example using the Synapse library and using UDP.
https://stackoverflow.com/a/18805052/1037511

You need to know the terms TCP, UDP and know that there are several libraries which can be used for communication.
The most used are Synapse, Indy, fcl-net and lNet.

Thaddy

  • Hero Member
  • *****
  • Posts: 14210
  • Probably until I exterminate Putin.
Re: can i make server?
« Reply #7 on: October 16, 2017, 12:08:42 pm »
I like synapse too, but you should also have a look at some standard packages that implement servers and are installed by default:
fcl-net
fcl-web

More than likely these are better suited for beginners and come with lots of examples.
Specialize a type, not a var.

shs

  • Sr. Member
  • ****
  • Posts: 310
Re: can i make server?
« Reply #8 on: October 16, 2017, 12:44:32 pm »
which one is easier to start with?

also can you show really simple example with it?
i saw the example from rvk but i'm really lost

shs

  • Sr. Member
  • ****
  • Posts: 310
Re: can i make server?
« Reply #9 on: October 16, 2017, 01:46:48 pm »
hi i found this tutorial do you think it works on lazarus as well? i couldn't find tclientsocket
https://www.youtube.com/watch?v=aiYY0tC0aE4&t=657s

piGrimm

  • Guest
Re: can i make server?
« Reply #10 on: October 16, 2017, 03:47:52 pm »

rvk

  • Hero Member
  • *****
  • Posts: 6112
Re: can i make server?
« Reply #11 on: October 16, 2017, 04:00:30 pm »
That one also uses Synapse and even threads. I don't think TS is ready for threads yet  %)

I always work with Synapse and think it's easiest and the SO-topic gave a simple example without threads.

But if somebody can give a working example with fpsock (from FPC fcl-net) that will be fine too.

Keep in mind... if TS already gets lost in the SO-example, I'm not sure if somebody here can give a more simpler answer.

bee

  • Sr. Member
  • ****
  • Posts: 393
Re: can i make server?
« Reply #12 on: October 16, 2017, 05:36:37 pm »
can i make server?
Sure… FPC/Lazarus can be used to make any programs you can imagine. But, you have to know first of what you're going to do.

Keep in mind... if TS already gets lost in the SO-example, I'm not sure if somebody here can give a more simpler answer.
I think TS doesn't really understand what s/he wants. S/he doesn't even know what kind of server and the details of program s/he's trying to make.
« Last Edit: October 16, 2017, 05:40:53 pm by bee »
-Bee-

A long time pascal lover.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8747
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: can i make server?
« Reply #13 on: October 17, 2017, 07:26:05 am »
@leledumbo
um not http so i guess it's tcp?
Do you know the difference? Do you know how TCP works? As I said earlier, it's not advised to build a car without knowing how the engine works. Lost in translation can be a disaster. The stackoverflow link rvk gave is simple enough to introduce how the client and server communicates, if you can't understand that, you don't understand the protocol. fcl-net, synapse and lnet all provide TCP functionality in different design, but neither is useful without proper understanding of the protocol itself. I don't suggest you dive into coding directly now, you will not get the idea so that it can be expanded for your specific needs.

benohb

  • Full Member
  • ***
  • Posts: 213
Re: can i make server?
« Reply #14 on: October 17, 2017, 09:06:39 am »
Quote
which one is easier to start with?
also can you show really simple example with it?


http://wiki.lazarus.freepascal.org/lNet

 

TinyPortal © 2005-2018