I'm new to programming and I'm trying to write a code for a port scanner. When I click Build I'm getting the following error messages...I realize it's the same error just in two different locations, but I figured it would hurt to list both:
Error 1 Program 'c:\Users\pat_000\Documents\Visual Studio 2013\Projects\WpfApplication2\WpfApplication2\obj\Debug\WpfApplication2.exe' has more than one entry point defined: 'PortScanner.Program.Main(string[])'. Compile with /main to specify the type that contains the entry point.
Error 2 Program 'c:\Users\pat_000\Documents\Visual Studio 2013\Projects\WpfApplication2\WpfApplication2\obj\Debug\WpfApplication2.exe' has more than one entry point defined: 'WpfApplication2.App.Main()'. Compile with /main to specify the type that contains the entry point.
Here is my code:
enter code here
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Threading;
using System.Net.Sockets;
using System.Net;
namespace PortScanner
{
class Program
{
static bool stop = false;
static int startPort;
static int endPort;
static List<int> openPorts = new List<int>();
static object consoleLock = new object();
static int waitingForResponses;
static int maxQueriesAtOneTime = 100;
static void Main(string[] args)
{
begin:
Console.WriteLine("Enter the IP Address of the target:");
string ip = Console.ReadLine();
IPAddress ipAddress;
if (!IPAddress.TryParse(ip, out ipAddress))
goto begin;
startP:
Console.WriteLine("Enter the starting port to start scanning on:");
string sp = Console.ReadLine();
if (!int.TryParse(sp, out startPort))
goto startP;
endP:
Console.WriteLine("Enter the end port:");
string ep = Console.ReadLine();
if (!int.TryParse(ep, out endPort))
goto endP;
Console.WriteLine("");
Console.WriteLine("");
Console.WriteLine("");
Console.WriteLine("");
Console.WriteLine("Press any key to stop scanning...");
Console.WriteLine("");
Console.WriteLine("");
ThreadPool.QueueUserWorkItem(StartScan, ipAddress);
Console.ReadKey();
stop = true;
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
static void StartScan(object o)
{
IPAddress ipAddress = o as IPAddress;
for (int i = startPort; i < endPort; i++)
{
lock (consoleLock)
{
int top = Console.CursorTop;
Console.CursorTop = 7;
Console.WriteLine("Scanning port: {0} ", i);
Console.CursorTop = top;
}
while (waitingForResponses >= maxQueriesAtOneTime)
Thread.Sleep(0);
if (stop)
break;
try
{
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
s.BeginConnect(new IPEndPoint(ipAddress, i), EndConnect, s);
Interlocked.Increment(ref waitingForResponses);
}
catch (Exception)
{
}
}
}
static void EndConnect(IAsyncResult ar)
{
try
{
DecrementResponses();
Socket s = ar.AsyncState as Socket;
s.EndConnect(ar);
if (s.Connected)
{
int openPort = Convert.ToInt32(s.RemoteEndPoint.ToString().Split(':')[1]);
openPorts.Add(openPort);
lock (consoleLock)
{
Console.WriteLine("Connected TCP on port: {0}", openPort);
}
s.Disconnect(true);
}
}
catch (Exception)
{
}
}
static void IncrementResponses()
{
Interlocked.Increment(ref waitingForResponses);
PrintWaitingForResponses();
}
static void DecrementResponses()
{
Interlocked.Decrement(ref waitingForResponses);
PrintWaitingForResponses();
}
static void PrintWaitingForResponses()
{
lock (consoleLock)
{
int top = Console.CursorTop;
Console.CursorTop = 8;
Console.WriteLine("Waiting for responses from {0} sockets ", waitingForResponses);
Console.CursorTop = top;
}
}
}
}
namespace WpfApplication2
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
You obviously want to write a ConsoleApplication. You picked WpfApplication. Copy your whole code, create a new project based on ConsoleApplication and paste your code there.
And try to get rid of the gotos; it's not BASIC. You could easily make a single function for all your three uses.
Try looking in your other solution files to see if there's another Main() defined somewhere else that is just confusing the compiler.
In a WPF application, Main() is automatically created for you. Since you also provided your own, that is why you are getting the conflict. To fix this:
Right-click App.xaml in the solution explorer, select Properties
Change 'Build Action' to 'Page'
Related
I am trying to send a Midi Note On message out to DAW software using NAudio, with a virtual port created by teVirtualMIDI. I am able to see the "device" created by teVirtualMIDI in Ableton Live 10, but have been unsuccessful in receiving any information in Live. My sound is turned up, and I never see Live's Midi meter move. The Code is as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using NAudio.Midi;
using TobiasErichsen.teVirtualMIDI;
namespace BDBConsole_1_0
{
public class BDBMidiClient
{
public static ConsoleKeyInfo cKi;
public static TeVirtualMIDI port;
static MidiOut midiOut;
int midiOutIndex;
//public static List<MidiEvent> noteEvent;
static void Main(string[] args)
{
CreateMidiPort();
}
public static void CreateMidiPort()
{
TeVirtualMIDI.logging(TeVirtualMIDI.TE_VM_LOGGING_MISC | TeVirtualMIDI.TE_VM_LOGGING_RX | TeVirtualMIDI.TE_VM_LOGGING_TX);
string portName = "BDB Client";
//port = new TeVirtualMIDI(portName, 65535, TeVirtualMIDI.TE_VM_FLAGS_INSTANTIATE_BOTH);
port = new TeVirtualMIDI(portName);
Console.WriteLine("New Midi Port Opened...");
Console.ReadKey();
EnumerateMidiOutDevices();
Thread thread = new Thread(new ThreadStart(SendNextMidiOutMessage));
thread.Start();
//SendNextMidiOutMessage();
}
public static void EnumerateMidiOutDevices()
{
int noOutDevices = MidiOut.NumberOfDevices;
Console.WriteLine("No. of Midi Out Devices..." + noOutDevices);
Console.ReadKey();
string deviceOutOne = MidiOut.DeviceInfo(1).ProductName;
Console.WriteLine("Device One..." + deviceOutOne);
Console.ReadKey();
}
public static void SendNextMidiOutMessage()
{
midiOut = new MidiOut(deviceNo: 0);
//events = new List<MidiEvent>();
int channel = 1;
int note = 64;
var noteOnEvent = new NoteOnEvent(0, channel, note, 127, 1000);
try
{
//while (true) loop here before
do
{
Console.WriteLine("Send Midi Note...");
cKi = Console.ReadKey();
midiOut.Send(noteOnEvent.GetAsShortMessage());
Console.WriteLine("Note Sent...");
cKi = Console.ReadKey();
} while (cKi.Key != ConsoleKey.Escape);
port.shutdown();
Console.WriteLine("Midi Port Closed...");
Console.ReadKey();
}
catch (Exception ex)
{
Console.WriteLine("thread aborting: " + ex.Message);
}
}
}
}
Any Help with this would be greatly appreciated!
First, I want to apologize if this seem like I shouldn't post this question. I have been battling to understand this code since the last 2 weeks and all to no avail.
My main problem is understanding how this delegate works here
messageInformer = new MessageInformer(this.Broadcast);
I couldn't use debugger to trace the code as VS won't let me do that. I understand the Socket connection, sending and receiving, but I don't get how the delegate work here. From what I noticed, after connecting multiple clients to the server, when a client sends a message to a Server, other clients get the same message as the server
I have an understanding of delegate as a function pointer and I know the basics of delegate.
Please could someone explain to me the flow of how this delegate is used?
Find all codes below:
Server.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.Threading;
namespace SimpleChatServer.Communication
{
class Server
{
private Socket serverSock;
private List<ClientHandler> clientsConnected = new List<ClientHandler>();
private MessageInformer messageInformer;
public Server()
{
serverSock = new Socket(
AddressFamily.InterNetwork,
SocketType.Stream,
ProtocolType.Tcp);
Console.WriteLine("Socket created");
serverSock.Bind(
new IPEndPoint(IPAddress.Loopback, 8055));
Console.WriteLine("Binding done");
serverSock.Listen(5);
Console.WriteLine("Listening started");
messageInformer = new MessageInformer(this.Broadcast);
}
public void StartAccepting()
{
while (true)
{
clientsConnected.Add(new ClientHandler(serverSock.Accept(), messageInformer));
Thread thread = new Thread(new ParameterizedThreadStart(clientsConnected.Last().StartReceiving));
thread.Start();
Console.WriteLine("New Client accepted");
}
}
private void Broadcast(Socket caller, string message)
{
foreach (var item in clientsConnected)
{
if(!item.ClientSock.Equals(caller))
item.ClientSock.Send(Encoding.UTF8.GetBytes(message));
}
}
}
}
ClientHandler.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
namespace SimpleChatServer.Communication
{
class ClientHandler
{
private Socket clientSock;
private MessageInformer informer;
public Socket ClientSock
{
get { return clientSock; }
//set { clientSock = value; }
}
private byte[] buffer = new byte[512];
public ClientHandler(Socket clientSock, MessageInformer informer)
{
this.clientSock = clientSock;
this.informer = informer;
}
/// <summary>
/// Receive messages from the client
/// </summary>
/// <param name="obj"></param>
public void StartReceiving(object obj)
{
int length;
string name = "";
string message = "";
#region Handle Name
do
{
length = clientSock.Receive(buffer);
name += Encoding.UTF8.GetString(buffer, 0, length);
} while (!name.Contains("\r\n"));
name = name.Substring(0, name.Length - 2);
clientSock.Send(Encoding.UTF8.GetBytes("hello " + name + "\r\n"));
#endregion
while (true)
{
length = clientSock.Receive(buffer);
message += Encoding.UTF8.GetString(buffer, 0, length);
if (message.Contains("\r\n"))
{
Console.Write(name + ": " + message);
informer(clientSock, name + ": " + message);
message = "";
}
}
}
}
}
Delegaters.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
namespace SimpleChatServer.Communication
{
public delegate void MessageInformer(Socket caller, string message);
}
program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SimpleChatServer.Communication;
namespace SimpleChatServer
{
class Program
{
static void Main(string[] args)
{
Server server = new Server();
server.StartAccepting();
server.StartAccepting();
Console.ReadLine();
}
}
}
Let's start from top to bottom:
public delegate void MessageInformer(Socket caller, string message);
This is the delegate definition, no work is done here yet.
messageInformer = new MessageInformer(this.Broadcast);
This sets the private variable messageInformer (which is of the MessageInformer delegate type) to a new Value: an instantiated delegate targeting this class' method Broadcast. Which has to have the same Parameters as the delegate type to be appliable as a target for this delegate. Compare these Parameters:
public delegate **void** MessageInformer(**Socket** caller, **string** message);
private **void** Broadcast(**Socket** caller, **string** message)
calling messageInformer(mySocket, myMessage); would now redirect the call to Server.Broadcast(mySocket, MyMessage), regardless from where this delegate is called, as this delegate is bound to this instance of Server's Broadcast method and not dependant on the context in which it is called.
clientsConnected.Add(new ClientHandler(serverSock.Accept(), messageInformer));
this line creates a new ClientHandler with a newly connected socket and provides it with the messageInformerDelegate which still points to Server.Broadcast even if it now is given to ClientHandler. The delegate is then saved as informer inside the ClientHandler.
informer(clientSock, name + ": " + message);
This line inside the ClientHandler.StartReceiving Method now calls the Server.BroadCast Method providing it's own socket and the message it received. It could be chaned to myServer.Broadcast(clientSock, name + ": "+ message); if you'd own a reference to your server inside your ClientHandler.
the Server.Broadcast method then loops through all Sockets, and forwards the recived message, aber checking if the Socket provided by the delegate call (which is always the calling Clienthandler's socket in this case) would be the socket that this message is forwarded to.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Hey guys I am new at the subject of Sockets
and I really need you help.
I am doing system of server and clients (like chat)
but something diffrent, I am doing it with Windows Form Application
in my server : I have list of sockets of all pepole that connect to the server, that already get acception from the server.
And I wanna to do a Timer that every X seconds it will runs on my List and check if the person is still connection I mean in that , that the person still connect on the internet and still can get packages and if not to remove him from the list.
someone can help me in c# how do it??
now at the server if someone is Exit the program Or if the internet is logout how i can check if the Client is out
and if yes so Close his connection?
i Read about TimeOut but how use it??? if it usfull?
Server:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Server
{
public partial class Form1 : Form
{
Socket sck;
static List<Socket> acc;
static List<Thread> thr;
//List<UserAt> thr;
static int port = 9000;
static IPAddress ip;
static Thread NewCon;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
acc = new List<Socket>();
//thr = new List<UserAt>();
thr = new List<Thread>();
NewCon = new Thread(getNewConnection);
//Console.WriteLine("please enter your host port ");
string inputPort = "9000";
try
{
port = Convert.ToInt32(inputPort);
}
catch
{
port = 9000;
}
ip = IPAddress.Parse("127.0.0.1");
sck = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
sck.Bind(new IPEndPoint(ip, port));
sck.Listen(0);
NewCon.Start();
}
/// <summary>
/// get new connection from client
/// </summary>
public void getNewConnection()
{
while (true)
{
acc.Add(sck.Accept());
var t = new Thread(() => ReciveMessage(acc.Count-1));
t.Start();
thr.Add(t);
/* UserAt a = new UserAt();
a.index = acc.Count - 1;
a.thread = new Thread(() => ReciveMessage(a.index));
a.thread.Start();
thr.Add(a);
* */
}
}
public void ReciveMessage(int index)
{
while (true)
{
try
{
Thread.Sleep(500);
byte[] Buffer = new byte[255];
int rec = acc[index].Receive(Buffer, 0, Buffer.Length, 0);
Array.Resize(ref Buffer, rec);
//MessageBox.Show(Encoding.Default.GetString(Buffer));
//listBox1.Items.Add(Encoding.Default.GetString(Buffer));
SetText(Encoding.Default.GetString(Buffer));
}
catch
{
// thr[index].thread.Abort();
/*thr.RemoveAt(index);
for (int i = index+1; i < thr.Count;i++ )
{
thr[i].index -= 1;
}*/
break;
}
}
}
delegate void SetTextCallback(string text);
private void SetText(string text)
{
// InvokeRequired required compares the thread ID of the
// calling thread to the thread ID of the creating thread.
// If these threads are different, it returns true.
if (this.listBox1.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { text });
}
else
{
this.listBox1.Items.Add(text);
}
}
public string getIp()
{
IPHostEntry host;
string localIP = "?";
host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
localIP = ip.ToString();
}
}
return localIP;
}
}
}
Client
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Client
{
public partial class Form1 : Form
{
static string name = "";
static int port = 9000;
static IPAddress ip;
static Socket sck;
public Form1()
{
InitializeComponent();
}
public void ReciveMessage()
{
while (true)
{
Thread.Sleep(500);
byte[] Buffer = new byte[255];
int rec = sck.Receive(Buffer, 0, Buffer.Length, 0);
Array.Resize(ref Buffer, rec);
SetText(Encoding.Default.GetString(Buffer));
//MyChat.Items.Add(Encoding.Default.GetString(Buffer));
}
}
delegate void SetTextCallback(string text);
private void SetText(string text)
{
// InvokeRequired required compares the thread ID of the
// calling thread to the thread ID of the creating thread.
// If these threads are different, it returns true.
if (this.MyChat.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { text });
}
else
{
this.MyChat.Items.Add(text);
}
}
private void Login_Click(object sender, EventArgs e)
{
name = UserName.Text;
ip = IPAddress.Parse("127.0.0.1");
string inputPort = "9000";
try
{
port = Convert.ToInt32(inputPort);
}
catch
{
port = 9000;
}
try
{
sck = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
sck.Connect(new IPEndPoint(ip, port));
ReciveMes.Enabled = true;
byte[] conmsg = Encoding.Default.GetBytes("<" + name + ">" + " connected");
sck.Send(conmsg, 0, conmsg.Length, 0);
SendToServer.Enabled = true;
}
catch
{
MessageBox.Show("חיבור נכשל");
}
}
private void SendToServer_Click(object sender, EventArgs e)
{
byte[] sdata = Encoding.Default.GetBytes("<" + name + ">" + MyMessage.Text);
sck.Send(sdata, sdata.Length, 0);
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if(SendToServer.Enabled)
{
byte[] sdata = Encoding.Default.GetBytes("<" + name + ">" + "Is Quit");
sck.Send(sdata, sdata.Length, 0);
}
}
}
}
I have a program that ping and take all the ip address that are active in a LAN i code it with csharp console mode the problem is that when I put it in mode form an error appear in Spinwatch and a error message box appear
Here is the code and error below
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.NetworkInformation;
using System.Threading;
namespace pingagediffusiontest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{ }
private static List<Ping> pingers = new List<Ping>();
private static int instances = 0;
private static object #lock = new object();
private static int result = 0;
private static int timeOut = 250;
private static int ttl = 5;
static void Mains()
{
string baseIP = "192.168.1.";
Console.WriteLine("Pinging 255 destinations of D-class in {0}*", baseIP);
CreatePingers(255);
PingOptions po = new PingOptions(ttl, true);
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
byte[] data= enc.GetBytes("abababababababababababababababab");
SpinWait wait = new SpinWait();
int cnt = 1;
Stopwatch watch = Stopwatch.StartNew();
foreach (Ping p in pingers) {
lock (#lock) {
instances += 1;
}
p.SendAsync(string.Concat(baseIP, cnt.ToString()), timeOut, data, po);
cnt += 1;
}
while (instances > 0) {
wait.SpinOnce();
}
watch.Stop();
DestroyPingers();
Console.WriteLine("Finished in {0}. Found {1} active IP-addresses.", watch.Elapsed.ToString(), result);
Console.ReadKey();
}
public static void Ping_completed(object s, PingCompletedEventArgs e)
{
lock (#lock) {
instances -= 1;
}
if (e.Reply.Status == IPStatus.Success) {
Console.WriteLine(string.Concat("Active IP: ", e.Reply.Address.ToString()));
result += 1;
} else {
Console.WriteLine(String.Concat("Non-active IP: ", e.Reply.Address.ToString()))
}
}
private static void CreatePingers(int cnt)
{
for (int i = 1; i <= cnt; i++) {
Ping p = new Ping();
p.PingCompleted += Ping_completed;
pingers.Add(p);
}
}
private static void DestroyPingers()
{
foreach (Ping p in pingers) {
p.PingCompleted -= Ping_completed;
p.Dispose();
}
pingers.Clear();
}
}
}
Error 1 The type or namespace name 'SpinWait' could not be found
Error 3 The type or namespace name 'Stopwatch' could not be found
Error 4 The name 'Stopwatch' does not exist in the current context
Just add the
using System.Diagnostics;
At the top of your file.
Error 3 The type or namespace name 'Stopwatch' could not be found
You need to import following namespace to use StopWatch in your program:
using System.Diagnostics;
as suggested by #CodeCaster in comments - you are missing semicolon to terminate the Console.WriteLine() statement :
Console.WriteLine(String.Concat("Non-active IP: ", e.Reply.Address.ToString())) //missing semicolon
Suggestion : as you have stated you converted code from Console Application to Windows Forms Application it would be nice if you can change/replace all Console.WriteLine() Statements with MessageBox.Show() as shown below:
MessageBox.Show(String.Concat("Non-active IP: ", e.Reply.Address.ToString()));
I have a big problem, but probably it's only big for me :). "terminal.Bind(client);" this line causes my program to hang if IP is bad. I want to stop this program after 5s working because if IP is wrong after 10s all program is hang.. :(
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rebex.TerminalEmulation;
using Rebex.Security;
using Rebex.Net;
namespace Routers_info_v._1
{
class Program
{
static void Main(string[] args)
{
Telnet client = new Telnet("192.168.1.1");
VirtualTerminal terminal = new VirtualTerminal(80, 25);
terminal.Bind(client);
terminal.SendToServer("pass\r");
terminal.SendToServer("sys ver\r");
TerminalState state;
do
{
state = terminal.Process(2000);
} while (state == TerminalState.DataReceived);
terminal.Save("terminal.txt", TerminalCaptureFormat.Text, TerminalCaptureOptions.DoNotHideCursor);
terminal.Unbind();
terminal.Dispose();
}
}
}
Try to wrap the call in a try catch (assuming some exception is thrown):
try
{
terminal.Bind(client);
}
catch(Exception ex)
{
return;
}
You could kick off the Bind in a thread, and start a timer, if the thread takes X seconds too long to complete, you could kill the thread, or your application, whichever you choose.
You can use Task.Wait. Here is little simulation for an operation which will take 10 sec and you are waiting it for 5 sec to finish :)
using System;
using System.Linq;
using System.Data.Linq;
using System.Data;
using System.Threading.Tasks;
namespace ConsoleApplication5
{
class VirtualTerminal
{
public VirtualTerminal(int a, int b) { }
public bool Bind() { System.Threading.Thread.Sleep(10000); return true; }
}
class Program
{
static void Main(string[] args)
{
VirtualTerminal terminal = new VirtualTerminal(80, 25);
Func<bool> func = () => terminal.Bind() ;
Task<bool> task = new Task<bool>(func);
task.Start();
if (task.Wait(5*1000))
{
// you got connected
}
else
{
//failed to connect
}
Console.ReadLine();
}
}
}
I would suggest to put the network stuff into a second thread, which then may be aborted by the main thread.
class Program {
static void Main(string[] args) {
Thread thread = new Thread(threadFunc);
thread.Start();
Stopwatch watch = new Stopwatch();
watch.Start();
while (watch.ElapsedMilliseconds < 5000 && thread.IsAlive)
;
if (!thread.IsAlive) {
thread.Abort();
Console.WriteLine("Unable to connect");
}
}
private static void threadFunc() {
Telnet client = new Telnet("192.168.1.1");
VirtualTerminal terminal = new VirtualTerminal(80, 25);
terminal.Bind(client);
// ...
terminal.Dispose();
}
}