* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: can i make server?
« Last post by shs on Today at 12:48:50 pm »
Quote
(over the internet you can't use the broadcast because you can't broadcast one message to every computer on the internet. There you must use a client-message and record that the client is active)

i don't really get what this means
what is the difference between internet and local network?

i just want certain people to connect my server on the internet
2
General / Re: What are we missing?
« Last post by Handoko on Today at 12:45:11 pm »
Starting form Lazarus 1.8.0, Online Package Manager is part of Lazarus. I tested on Lazarus 1.8.0RC5, it is not enabled by default. You just need to open, compile and use/install it manually. For older version of Lazarus, it is a separate download.

Read more:
http://wiki.freepascal.org/Online_Package_Manager
3
General / Re: can i make server?
« Last post by rvk on Today at 12:32:34 pm »
how do i know if the client is listening or not?
That depends.

In a local network you can do a broadcast on UDP and everyone who is listening can answer back.

For TCP you'll need one "server" which is always listening. Clients can connect to that server via TCP. That way the server knows who the clients are.

It all depends on what kind of messaging system you want to make.

(over the internet you can't use the broadcast because you can't broadcast one message to every computer on the internet. There you must use a client-message and record that the client is active)
4
General / Re: can i make server?
« Last post by shs on Today at 12:30:14 pm »
how do i know if the client is listening or not?
5
General / Re: can i make server?
« Last post by rvk on Today at 12:27:42 pm »
i googled socket and i kinda don't get it. it say socket is connection between 2 programs, so it doesn't work if programs are more than 3? also does udp need socket to make a server?
Yes, for UDP you also need a socket.
For TCP you can only connect to one computer per socket. If you need to connect to multiple computers you'll need to use multiple sockets. The upside of UDP is that you can use one socket to broadcast one message to multiple computers listening to it.

Quote
In the standard Internet protocols TCP and UDP, a socket address is the combination of an IP address and a port number, much like one end of a telephone connection is the combination of a phone number and a particular extension. Sockets need not have an address, for example, for only sending data, but if a program binds a socket to an address, the socket can be used to receive data sent to that address. Based on this address, Internet sockets deliver incoming data packets to the appropriate application process.
https://en.wikipedia.org/wiki/Network_socket

So a socket is just a other name for connection (UDP or TCP or otherwise).

For TCP connections the connection is really from IP <-> IP. That's why it's guaranteed that the message is received correctly. The underlying TCP-protocol handles the acknowledgements of packages to eachother.

For UDP you just send out a package over the network with address and port and forget about it. It's up to the client to be listening. If it is not, then the package just gets lost. And if you really want to make sure the package is received you can do the acknowledgements yourself.

So sockets are just a means by which you "begin" using UDP or TCP.
https://docs.oracle.com/javase/tutorial/networking/sockets/definition.html
Quote
A socket is one endpoint of a two-way communication link between two programs running on the network. A socket is bound to a port number so that the TCP layer can identify the application that data is destined to be sent to.
6
LCL / How to change the color of the node branches of TreeView
« Last post by tomitomy on Today at 12:26:18 pm »
Hi, How to change the color of the node branches of TreeView, see attachment. Thanks!
7
Beginners / Re: Hide Caret (TRichMemo, TKMemo)
« Last post by tudi_x on Today at 12:19:41 pm »
Hi All,
how does one hide the caret in FPC in Memo controls (cross platform and with no other control to lose focus)? read only looks like not enough.
i see in Delphi there is a HideCaret(<control>) function.

thank you
8
General / Re: can i make server?
« Last post by shs on Today at 12:17:59 pm »
thank you for clear explanation

i googled socket and i kinda don't get it. it say socket is connection between 2 programs, so it doesn't work if programs are more than 3? also does udp need socket to make a server?
9
General / Re: What are we missing?
« Last post by Greeniemax on Today at 12:13:06 pm »
Yes that is true but it's not part of Lazarus, it's a package someone has to install.

If this is provided as a companion program that could be loaded from packages menu life for a beginner becomes easier.
10
General / Re: can i make server?
« Last post by rvk on Today at 11:54:56 am »
i watched the video on youtube talking about UDP and TCP and it says TCP is better for texting because  UDP doesn't do retransimissions so some message can get lost.

but why is UDP used in the example?
You can easily make the same example use TCP.

You can use UDP but UDP does not guarantee that the message is received. You can however implement an acknowledge package yourself (send OK+messagenumber back to the sender). If the sender does not receive it, it can retransmit the message.

The advantage of UDP is that you can broadcast message to the entire network so that all clients listening on a specific port receive that message. With TCP you would need to establish a connection with each client.

Also, with TCP you'll need to know the IP of the client (other side) to establish a connection. With UDP (broadcast) you can use UDP and in the message-package you can put a client-name. All clients will receive the same package but only act if their client-name is in the package. This is not really secure (because everyone receives the message) but is security is an issue you should build in some encryption too. But that's beyond the scope of your question.
Pages: [1] 2 3 ... 10

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus