using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Net.Sockets; namespace CustomerOrderProcessing { namespace Transport { internal class TcpIpChannel { TcpClient _client; NetworkStream _stream; public TcpIpChannel() { String[] args = Environment.GetCommandLineArgs(); _client = new TcpClient( args[1], int.Parse(args[2]) ); _stream = _client.GetStream(); } public void Send(byte[] data) { _stream.Write(data, 0, data.Length); } public byte[] Recieve() { byte[] buffer = new byte[1024]; _stream.Read(buffer, 0, buffer.Length); return buffer; } } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)