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

            sendEntityDelegate = new delVoidEntity(AddBullet);
            sendText           = new delVoidString(UpdateText);
        }
コード例 #2
0
ファイル: Connection.cs プロジェクト: InfestedBlaze/CMPE2800
        public Connection(Socket inSock, delVoidInt DataOutFunc, delVoidString DisconnectFunc)
        {
            connection = inSock;
            OutputData = DataOutFunc;
            Disconnect = DisconnectFunc;

            Thread thread = new Thread(ThreadReading);

            thread.IsBackground = true;
            thread.Start();
        }
コード例 #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();
    }
コード例 #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);
    }