Asynchronous Sockets
From: Andrew Ducker (Andrew_at_Ducker.org.uk)
Date: 10/23/04
- Next message: Frank: "C# Process Handle from ProcessID"
- Previous message: Andrew Ducker: "Re: C# WinApp as a stand alone application"
- Next in thread: Steven Cheng[MSFT]: "RE: Asynchronous Sockets"
- Reply: Steven Cheng[MSFT]: "RE: Asynchronous Sockets"
- Reply: Robert Jordan: "Re: Asynchronous Sockets"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 23 Oct 2004 09:30:21 -0700
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
- Next message: Frank: "C# Process Handle from ProcessID"
- Previous message: Andrew Ducker: "Re: C# WinApp as a stand alone application"
- Next in thread: Steven Cheng[MSFT]: "RE: Asynchronous Sockets"
- Reply: Steven Cheng[MSFT]: "RE: Asynchronous Sockets"
- Reply: Robert Jordan: "Re: Asynchronous Sockets"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|