예제 #1
0
        public void send(object obj)
        {
            try
            {
                createConnection();
                String msg = (String)obj;

                NetworkStream clientStream = client.GetStream();

                StreamWriter SWriter = new StreamWriter(getStream(clientStream));

                //Schreiben auf dem Stream
                SWriter.WriteLine(msg);

                //Close all the connections.
                SWriter.Close();
                clientStream.Flush();
                ConnectionClosed();
            }
            catch (Exception ef)
            {
                owner.BalloonTipText("Der Server ist nicht erreichbar. Überprüfen Sie ihre Verbindungsparameter.", System.Windows.Forms.ToolTipIcon.Error);
            }
        }