-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
45 lines (34 loc) · 1003 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace etc
{
class Program
{
static void Main(string[] args)
{
string host = args[0];
int port = int.Parse(args[1]);
Console.WriteLine(string.Format("Connecting to {0}:{1}", host, port));
string runID = string.Format("{0}-{1}", host, port);
var client = new TcpClient(host, port);
var stream = client.GetStream();
var market = new Market(stream, runID);
Task.Run(() => market.SendLoop());
market.Hello();
//var bonds = new BondMarketMaker(market);
//Task.Run(() => { bonds.Main(); });
//var adr = new ADRArbitrager(market);
//Task.Run(() => { adr.Main(); });
var etf = new ETFArbitrager(market);
Task.Run(() => { etf.Main(); });
Task recvTask = Task.Run(() => market.ReceiveLoop());
Task.Run(() => market.DumpLoop());
Task.Run(() => market.OutputLoop());
recvTask.Wait();
}
}
}