www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - My Client/Server Internet created with Dlang

reply Marcone <marcone email.com> writes:
Please see my code. What do you think about my bad code?

My Code: 
https://github.com/cerejavermelha/Dlang-Client-Server-Socket-Dropbear-Injector/blob/master/Dlang_Client_Server_Socket_Dropbear_Injector.d
Feb 02 2021
parent reply Energo Koder <energokoder adres.pl> writes:
Please answer me for these questions:

1. I can see in linked file one function conecta() (beside 
main()). This drive me to question: Is conecta() act one time as 
server and another time as client?

2. Do you introduce you app with:
import core.stdc.stdlib;
This drive me to question: Is the C API the the only way do 
access Internet?
Feb 02 2021
next sibling parent Energo Koder <energokoder adres.pl> writes:
 This drive me to question: Is the C API the the only way do 
 access Internet?
Mean: from D lang, ofcourse...
Feb 02 2021
prev sibling next sibling parent Marcone <marcone email.com> writes:
On Tuesday, 2 February 2021 at 17:03:58 UTC, Energo Koder wrote:
 Please answer me for these questions:

 1. I can see in linked file one function conecta() (beside 
 main()). This drive me to question: Is conecta() act one time 
 as server and another time as client?

 2. Do you introduce you app with:
 import core.stdc.stdlib;
 This drive me to question: Is the C API the the only way do 
 access Internet?
1. Server for receive local aplication and client to connect local applicatio to remote server i iternet. 2. core.stdc.stdlib is only for use function exit(0) for close proccess.
Feb 02 2021
prev sibling parent Gregor =?UTF-8?B?TcO8Y2ts?= <gregormueckl gmx.de> writes:
On Tuesday, 2 February 2021 at 17:03:58 UTC, Energo Koder wrote:
 Please answer me for these questions:

 2. Do you introduce you app with:
 import core.stdc.stdlib;
 This drive me to question: Is the C API the the only way do 
 access Internet?
The code uses std.socket for networking. This is part of Phobos and is heavily inspired by the BSD socket interface, but tweaks it into something more D-ish.
Feb 03 2021