<commit_before>package socks {

    import asunit.asserts.*;
    import asunit.framework.IAsync;

	public class EndPointTest {
        
        [Inject]
        public var async:IAsync;

		private var server:EndPoint;
		private var client:EndPoint;

        private var serverHandler:Function;
        private var clientHandler:Function;

        [Before]
		public function setUp():void {
			server = new EndPoint("EndPointTest", null, false, 0);
            client = new EndPoint("EndPointTest", null, false, 0);
		}

        [After]
		public function tearDown():void {
            server.close();
            client.close();

			server = null;
            client = null
		}

        [Test]
		public function canConnectTwoWay():void {
            // Set up two async handlers:
            serverHandler = async.add(null, 500);
            clientHandler = async.add(null, 500);

            // Connect to both endpoints:
            server.connect(this);
            client.connect(this);

            // Send a message across both endpoints:
            client.send('clientMethod');
            server.send('serverMethod');
		}

        public function serverMethod():void {
            serverHandler();
        }

        public function clientMethod():void {
            clientHandler();
        }
	}
}
<commit_msg>Added isServer flag to 2-way endpoint test<commit_after>package socks {

    import asunit.asserts.*;
    import asunit.framework.IAsync;

	public class EndPointTest {
        
        [Inject]
        public var async:IAsync;

		private var server:EndPoint;
		private var client:EndPoint;

        private var serverHandler:Function;
        private var clientHandler:Function;

        [Before]
		public function setUp():void {
			server = new EndPoint("EndPointTest", null, false, 0);
            client = new EndPoint("EndPointTest", null, false, 0);
		}

        [After]
		public function tearDown():void {
            server.close();
            client.close();

			server = null;
            client = null
		}

        [Test]
		public function canConnectTwoWay():void {
            // Set up two async handlers:
            serverHandler = async.add(null, 500);
            clientHandler = async.add(null, 500);

            // Connect to both endpoints:
            server.connect(this, true);
            client.connect(this);

            // Send a message across both endpoints:
            client.send('clientMethod');
            server.send('serverMethod');
		}

        public function serverMethod():void {
            serverHandler();
        }

        public function clientMethod():void {
            clientHandler();
        }
	}
}

{'fraction_non_alphanumeric': 0.10033695245226507, 'fraction_numerical': 0.00636465743167353, 'mean_word_length': 1.9394939493949395, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4487168', 'n_tokens_mistral': 745, 'n_tokens_neox': 673, 'n_words': 183}