Exemple #1
0
        static void Main(string[] args)
        {
            var link = new Link(1000);

            var ByteArray = Encoding.ASCII.GetBytes ("FALLOUTERAWESOME");

            link.send (ByteArray, ByteArray.Length);
        }
		public Transport (int BUFSIZE)
		{
			link = new Link(BUFSIZE+(int)TransSize.ACKSIZE);
			checksum = new Checksum();
			buffer = new byte[BUFSIZE+(int)TransSize.ACKSIZE];
			seqNo = 0;
			old_seqNo = DEFAULT_SEQNO;
			errorCount = 0;
		}
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Transport"/> class.
 /// </summary>
 public Transport(int BUFSIZE)
 {
     link = new Link(BUFSIZE + HEADER_SIZE);
     checksum = new Checksum();
     TRANSBUFSIZE = BUFSIZE;
     buffer = new byte[TRANSBUFSIZE + HEADER_SIZE];
     seqNo = 0;
     old_seqNo = DEFAULT_SEQNO;
     errorCount = 0;
 }
Exemple #4
0
        public static int Main(string[] args)
        {
            Link zelda = new Link(1000);

            Console.WriteLine ("Write somehting...");
            string read = Console.ReadLine ();

            Console.WriteLine ("Written line: " + read);

            byte[] buffer = Encoding.ASCII.GetBytes(read);

            zelda.send (buffer, buffer.Length);

            return 0;
        }