mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 04:18:43 +00:00
Merge branch 'networking' of https://github.com/CosmosOS/Cosmos into networking
This commit is contained in:
commit
3b242b4f0d
1 changed files with 5 additions and 5 deletions
|
|
@ -1,17 +1,17 @@
|
|||
# Network
|
||||
|
||||
In this article we will discuss about Networking on Cosmos, how to use the Network Stack, send and received packets. For now, availables protocols are **ARP**, **IPv4**, **UDP**, **ICMP**, **DHCP** and **DNS** but the team is also working on TCP.
|
||||
In this article we will discuss about Networking on Cosmos, how to use the Network Stack, send and received packets. For now, available protocols are **ARP**, **IPv4**, **UDP**, **ICMP**, **DHCP** and **DNS** but the team is also working on TCP.
|
||||
|
||||
All protocols here doesn't support every feature described by their RFC and may have some bugs or architecture issues, if you find something anormal please [submit an issue](http://https://github.com/CosmosOS/Cosmos/issues/new/choose "repository") on our repository.
|
||||
All protocols here don't necessary support every feature described by their RFC and may have some bugs or architecture issues, if you find something abnormal please [submit an issue](http://https://github.com/CosmosOS/Cosmos/issues/new/choose "repository") on our repository.
|
||||
|
||||
Each protocol have a Client class wich can be used to receive and send data. If a Receive() method is blocking, the method will timeout after 5 seconds or use the value optionnaly set by parameter. Please note that all finished connections should be closed using Close().
|
||||
Each protocol has a Client class which can be used to receive and send data. If a Receive() method is blocking, the method will timeout after 5 seconds or use the value optionally set by parameter. Please note that all finished connections should be closed using Close().
|
||||
|
||||
Cosmos Network Stack won't use Classes and Functions that are under .NET Core. Everything described here will be under:
|
||||
```csharp
|
||||
using Cosmos.System.Network;
|
||||
```
|
||||
|
||||
Before anything, a Network Configuration must be set (local machine IPv4 address, subnet mask and gateway). It can be manually set with IPConfig.Enable or dynamically set throught a DHCP server. For DHCP, Cosmos will ask to the DHCP server (usually default gateway) for an address in your local network.
|
||||
Before anything, a Network Configuration must be set (local machine IPv4 address, subnet mask and gateway). It can be manually set with IPConfig.Enable or dynamically set through a DHCP server. For DHCP, Cosmos will ask to the DHCP server (usually default gateway) for an address in your local network.
|
||||
|
||||
### Manually set IPv4 Config
|
||||
```csharp
|
||||
|
|
@ -64,7 +64,7 @@ int time = xClient.Receive(ref endpoint); //return elapsed time / timeout if no
|
|||
xClient.Close(); //don't forget to close!
|
||||
```
|
||||
## DNS
|
||||
DNS can be used to retrieve corresponse between a domain name and an IP address. For now DNS can only ask for one domain name at the same time.
|
||||
DNS can be used to get an IP address from a Domain Name string. For now DNS can only ask for one domain name at the same time.
|
||||
```csharp
|
||||
var xClient = new DnsClient();
|
||||
xClient.Connect(new Address(192, 168, 1, 254)); //DNS Server address
|
||||
|
|
|
|||
Loading…
Reference in a new issue