public Connect ( string host, int port ) : Stream | ||
host | string | |
port | int | |
Результат | Stream |
public Stream Connect(string host, int port)
{
_tcpClient = new TcpClient();
_tcpClient.Connect(host, port);
Stream stream = _tcpClient.GetStream();
if (_rawDumpFile != null)
{
stream = new CopyInputStream(stream, new FileStream(_rawDumpFile, FileMode.Create), true);
}
return ProcessStream(stream, true);
}
static void Main(string[] args) { using (var streamProvider = new PipBoyStreamProvider(DebugSettings.DumpTcpStream ? DebugSettings.TcpDumpFile : null)) { var stream = DebugSettings.UseTcp ? streamProvider.Connect(DebugSettings.Host, DebugSettings.Port) : streamProvider.ReadFile(DebugSettings.InputFile); using (stream) { ReadStream(stream); } } if (Debugger.IsAttached) { Console.WriteLine("finished"); Console.ReadLine(); } }