A
Andrew Ducker
I have the following code, which throws an error of "An invalid argument
was supplied" when I run it.
Can anyone tell me the stupid mistake I'm obviously making?
Socket listener = new Socket(*snipped*);
listener.Bind(localEndPoint);
while (true)
{
AsyncCallback MyCallback = new AsyncCallback(ConnectionMade);
listener.BeginAccept(MyCallback,listener);
}
public void ConnectionMade( IAsyncResult ar)
{
MessageBox.Show("Got an attempt to connect!");
}
The error happens on the line BeginAccept.
Any suggestions?
Andy D
was supplied" when I run it.
Can anyone tell me the stupid mistake I'm obviously making?
Socket listener = new Socket(*snipped*);
listener.Bind(localEndPoint);
while (true)
{
AsyncCallback MyCallback = new AsyncCallback(ConnectionMade);
listener.BeginAccept(MyCallback,listener);
}
public void ConnectionMade( IAsyncResult ar)
{
MessageBox.Show("Got an attempt to connect!");
}
The error happens on the line BeginAccept.
Any suggestions?
Andy D