Posted: Thu Jul 31, 2008 7:13 am Post subject: [Question, C#] Socket s = myList.AcceptSocket();
My current code is as follows
Code:
private void button3_Click(object sender, EventArgs e)
{
Socket s = myList.AcceptSocket();
richTextBox1.AppendText("Connection accepted from " + s.RemoteEndPoint + "\n");
byte[] b = new byte[100];
int k = s.Receive(b);
richTextBox1.AppendText("Recieved..." + "\n");
for (int i = 0; i < k; i++)
richTextBox1.AppendText(Convert.ToChar(b[i]).ToString());
s.Close();;
}
Instead of having too click on a button to accept connections, is there a way to have it always autoaccept connections?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum