Skip to content

Commit 44dab0f

Browse files
ADD: new example Send_get_file
1 parent d171c25 commit 44dab0f

File tree

9 files changed

+1512
-2
lines changed

9 files changed

+1512
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ Collection of classes and examples that are mainly related to Serial and Network
4141

4242
| Example | Description |
4343
| --- | --- |
44-
| [MQTT_Broker](TCP_IP/MQTT_Broker) | Shows a implementation of uMQTTbroker.pas (only publish / subscibe no evaluations) |
45-
| [MQTT_Publisher](TCP_IP/MQTT_Publisher) | Demo that can send MQTT Publish messages to a given IP-Address (no security login) |
4644
| [Modbus_Client](TCP_IP/Modbus_Client) | Application to emulate a MODBUS-Slave device |
4745
| [Modbus_Diagnostic](TCP_IP/Modbus_Diagnostic) | Shows a implementation for the MODBUS RTU, MODBUS-TCP and MODBUS-TCP RTU version, use to detect address offset and encoding of the MODBUS SLAVE |
46+
| [MQTT_Broker](TCP_IP/MQTT_Broker) | Shows a implementation of uMQTTbroker.pas (only publish / subscibe no evaluations) |
47+
| [MQTT_Publisher](TCP_IP/MQTT_Publisher) | Demo that can send MQTT Publish messages to a given IP-Address (no security login) |
48+
| [Send_get_file](TCP_IP/Send_get_file) | Demo to transmit a file between server and client with a TCP-IP connection using L-Net |
4849
| [Socket](TCP_IP/Socket) | Demo application that shows how to establish a TCP-IP connection with L-Net |
4950
| uMQTTbroker.pas | a simpliest MQTT broker, only capable of receiving publishing clients (need L-Net) |
5051
| uchunkmanager.pas | Server / Client component to send packages of data through a TCP-IP connection (need L-Net) |

TCP_IP/Send_get_file/Readme.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Send_get_file
2+
3+
This demo shows how to use the L-Net TLTCPComponent component to transmit a file between 2 computers
4+
5+
![](preview.png)
6+
7+
Features:
8+
- Listen to a port (Server)
9+
- Connect to a IP and port (Client)
10+
- send file from server to client / or send file from client to server
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<CONFIG>
3+
<ProjectOptions>
4+
<Version Value="12"/>
5+
<General>
6+
<Flags>
7+
<CompatibilityMode Value="True"/>
8+
</Flags>
9+
<SessionStorage Value="InProjectDir"/>
10+
<Title Value="project1"/>
11+
<ResourceType Value="res"/>
12+
<UseXPManifest Value="True"/>
13+
</General>
14+
<i18n>
15+
<EnableI18N LFM="False"/>
16+
</i18n>
17+
<BuildModes Count="1">
18+
<Item1 Name="Default" Default="True"/>
19+
</BuildModes>
20+
<PublishOptions>
21+
<Version Value="2"/>
22+
</PublishOptions>
23+
<RunParams>
24+
<local>
25+
<LaunchingApplication PathPlusParams="/usr/bin/xterm -T &apos;Lazarus Run Output&apos; -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
26+
</local>
27+
<FormatVersion Value="2"/>
28+
<Modes Count="1">
29+
<Mode0 Name="default">
30+
<local>
31+
<LaunchingApplication PathPlusParams="/usr/bin/xterm -T &apos;Lazarus Run Output&apos; -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
32+
</local>
33+
</Mode0>
34+
</Modes>
35+
</RunParams>
36+
<RequiredPackages Count="2">
37+
<Item1>
38+
<PackageName Value="lnetvisual"/>
39+
</Item1>
40+
<Item2>
41+
<PackageName Value="LCL"/>
42+
</Item2>
43+
</RequiredPackages>
44+
<Units Count="3">
45+
<Unit0>
46+
<Filename Value="Send_Get_File.lpr"/>
47+
<IsPartOfProject Value="True"/>
48+
</Unit0>
49+
<Unit1>
50+
<Filename Value="unit1.pas"/>
51+
<IsPartOfProject Value="True"/>
52+
<ComponentName Value="Form1"/>
53+
<HasResources Value="True"/>
54+
<ResourceBaseClass Value="Form"/>
55+
<UnitName Value="Unit1"/>
56+
</Unit1>
57+
<Unit2>
58+
<Filename Value="unit2.pas"/>
59+
<IsPartOfProject Value="True"/>
60+
<ComponentName Value="Form2"/>
61+
<HasResources Value="True"/>
62+
<ResourceBaseClass Value="Form"/>
63+
<UnitName Value="Unit2"/>
64+
</Unit2>
65+
</Units>
66+
</ProjectOptions>
67+
<CompilerOptions>
68+
<Version Value="11"/>
69+
<Target>
70+
<Filename Value="Send_Get_File"/>
71+
</Target>
72+
<SearchPaths>
73+
<IncludeFiles Value="$(ProjOutDir)"/>
74+
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
75+
</SearchPaths>
76+
<Linking>
77+
<Options>
78+
<Win32>
79+
<GraphicApplication Value="True"/>
80+
</Win32>
81+
</Options>
82+
</Linking>
83+
</CompilerOptions>
84+
<Debugging>
85+
<Exceptions Count="3">
86+
<Item1>
87+
<Name Value="EAbort"/>
88+
</Item1>
89+
<Item2>
90+
<Name Value="ECodetoolError"/>
91+
</Item2>
92+
<Item3>
93+
<Name Value="EFOpenError"/>
94+
</Item3>
95+
</Exceptions>
96+
</Debugging>
97+
</CONFIG>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
(******************************************************************************)
2+
(* *)
3+
(* Author : Uwe Schächterle (Corpsman) *)
4+
(* *)
5+
(* This file is part of Send_get_file *)
6+
(* *)
7+
(* See the file license.md, located under: *)
8+
(* https://github.com/PascalCorpsman/Software_Licenses/blob/main/license.md *)
9+
(* for details about the license. *)
10+
(* *)
11+
(* It is not allowed to change or remove this text from any *)
12+
(* source file of the project. *)
13+
(* *)
14+
(******************************************************************************)
15+
Program Send_Get_File;
16+
17+
{$MODE objfpc}{$H+}
18+
19+
Uses
20+
{$IFDEF UNIX}{$IFDEF UseCThreads}
21+
cthreads,
22+
{$ENDIF}{$ENDIF}
23+
Interfaces, // this includes the LCL widgetset
24+
Forms, lnetvisual, Unit1, Unit2;
25+
26+
{$R *.res}
27+
28+
Begin
29+
RequireDerivedFormResource := True;
30+
Application.Initialize;
31+
Application.CreateForm(TForm1, Form1);
32+
Application.CreateForm(TForm2, Form2);
33+
Application.Run;
34+
End.
35+

TCP_IP/Send_get_file/preview.png

103 KB
Loading

0 commit comments

Comments
 (0)