Example #1
0
        /// <summary>
        /// Set ups the delegate for the stuff
        /// </summary>
        public Form1()
        {
            InitializeComponent();

            sendEntityDelegate = new delVoidEntity(AddBullet);
            sendText           = new delVoidString(UpdateText);
        }
Example #2
0
        public Connection(Socket inSock, delVoidInt DataOutFunc, delVoidString DisconnectFunc)
        {
            connection = inSock;
            OutputData = DataOutFunc;
            Disconnect = DisconnectFunc;

            Thread thread = new Thread(ThreadReading);

            thread.IsBackground = true;
            thread.Start();
        }
Example #3
0
    public Connection(Socket inSock, delVoidString DisconnectFunc, delVoidString ErrorFunc, delVoidLineSegment OutputLine)
    {
        connection    = inSock;
        Disconnect    = DisconnectFunc;
        ErrorOccurred = ErrorFunc;
        OutputLineSeg = OutputLine;

        Thread thread = new Thread(ThreadReading);

        thread.IsBackground = true;
        thread.Start();

        thread = new Thread(ProcessThread);
        thread.IsBackground = true;
        thread.Start();
    }
Example #4
0
    public Connection(string Address, int Port, delVoidString DisconnectFunc, delVoidString ErrorFunc, delVoidLineSegment OutputLine)
    {
        try
        {
            connection = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        }
        catch (Exception err)
        {
            ErrorOccurred(err.Message);
            return;
        }

        Disconnect    = DisconnectFunc;
        ErrorOccurred = ErrorFunc;
        OutputLineSeg = OutputLine;

        EstablishConnection(Address, Port);
    }