Revize c6ecc85a
Přidáno uživatelem Jakub Hejman před téměř 4 roky(ů)
deltarobot-vr/Assets/DeltaRobotVr/Client.cs | ||
---|---|---|
18 | 18 |
public static readonly Client Instance = new Client(); |
19 | 19 |
|
20 | 20 |
// default server |
21 |
private const string DefaultServer = "127.0.0.1";
|
|
21 |
private const string DefaultHost = "127.0.0.1";
|
|
22 | 22 |
private const int DefaultPort = 4242; |
23 | 23 |
|
24 | 24 |
// protocol constants |
... | ... | |
277 | 277 |
{ |
278 | 278 |
try |
279 | 279 |
{ |
280 |
using var client = new TcpClient(DefaultServer, DefaultPort); |
|
280 |
var host = ConfigurationProvider.Instance.Host; |
|
281 |
var port = ConfigurationProvider.Instance.Port; |
|
282 |
|
|
283 |
if (port < 0 || host.Length == 0) |
|
284 |
{ |
|
285 |
// Obviously invalid values |
|
286 |
host = DefaultHost; |
|
287 |
port = DefaultPort; |
|
288 |
} |
|
289 |
|
|
290 |
using var client = new TcpClient(host, port); |
|
281 | 291 |
using var stream = client.GetStream(); |
282 | 292 |
BinaryReader reader = new BinaryReader(stream); |
283 | 293 |
BinaryWriter writer = new BinaryWriter(stream); |
Také k dispozici: Unified diff
Re #9003 - Client configuration