Click here to Skip to main content
15,914,447 members
Home / Discussions / C#
   

C#

 
Questioncalcalate running time Pin
zhujp9816-Feb-06 8:35
zhujp9816-Feb-06 8:35 
AnswerRe: calcalate running time Pin
CWIZO16-Feb-06 8:38
CWIZO16-Feb-06 8:38 
Questionhow to solve my problem about process injection in c# ? Pin
hdv21216-Feb-06 8:35
hdv21216-Feb-06 8:35 
AnswerRe: how to solve my problem about process injection in c# ? Pin
Dave Kreskowiak16-Feb-06 10:51
mveDave Kreskowiak16-Feb-06 10:51 
GeneralRe: how to solve my problem about process injection in c# ? Pin
Colin Angus Mackay16-Feb-06 13:15
Colin Angus Mackay16-Feb-06 13:15 
GeneralRe: how to solve my problem about process injection in c# ? Pin
Dave Kreskowiak16-Feb-06 14:14
mveDave Kreskowiak16-Feb-06 14:14 
Questiondirectx alpha blending Pin
kopi_b16-Feb-06 8:08
kopi_b16-Feb-06 8:08 
AnswerRe: directx alpha blending Pin
kopi_b18-Feb-06 8:06
kopi_b18-Feb-06 8:06 
QuestionPacks not getting to destination... Pin
Shy Agam16-Feb-06 7:56
Shy Agam16-Feb-06 7:56 
AnswerRe: Packs not getting to destination... Pin
Le centriste16-Feb-06 10:16
Le centriste16-Feb-06 10:16 
GeneralRe: Packs not getting to destination... Pin
Shy Agam16-Feb-06 13:52
Shy Agam16-Feb-06 13:52 
GeneralRe: Packs not getting to destination... Pin
Le centriste16-Feb-06 14:02
Le centriste16-Feb-06 14:02 
GeneralRe: Packs not getting to destination... Pin
Shy Agam17-Feb-06 2:44
Shy Agam17-Feb-06 2:44 
GeneralRe: Packs not getting to destination... Pin
Le centriste17-Feb-06 3:01
Le centriste17-Feb-06 3:01 
GeneralRe: Packs not getting to destination... Pin
Shy Agam17-Feb-06 8:11
Shy Agam17-Feb-06 8:11 
GeneralRe: Packs not getting to destination... Pin
Le centriste18-Feb-06 5:42
Le centriste18-Feb-06 5:42 
GeneralRe: Packs not getting to destination... Pin
Shy Agam18-Feb-06 10:18
Shy Agam18-Feb-06 10:18 
GeneralRe: Packs not getting to destination... Pin
Shy Agam17-Feb-06 8:35
Shy Agam17-Feb-06 8:35 
I forgot you wanted to see the code where my BeginAccept is...
Well... Here it is:

private void cmdListen_Click(object sender, EventArgs e)
{
    if (cmdListen.Text == "Listen")
    {
        try
        {
            IPEndPoint ipEP = new IPEndPoint
            (IPAddress.Any, int.Parse(txtPort.Text));

            if (sck == null)
                sck = new Socket(ipEP.Address.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

            sck.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);

            sck.Bind(ipEP);
            sck.Listen(100);
            sck.BeginAccept(new AsyncCallback(this.acceptCallBack), null);
            listening();
        }
        catch (Exception ex)
        {
            setStatus(ex.Message);
            this.Invoke(new booleanDelegate(performDisconnect), false);
        }
    }
    else performDisconnect(false);
}


I can't remember though, And why I set the Listen() method's backlog parameter to 100, and why I wrote this line:
sck.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);

Guess I'll end up posting the entire code here. Poke tongue | ;-P

-- modified at 14:36 Friday 17th February, 2006
QuestionWord automation Pin
Tom Wright16-Feb-06 7:47
Tom Wright16-Feb-06 7:47 
AnswerRe: Word automation Pin
Tom Wright16-Feb-06 8:53
Tom Wright16-Feb-06 8:53 
QuestionFinally Startup Edit Released Pin
Ahmad Mahmoud [candseeme]16-Feb-06 5:24
Ahmad Mahmoud [candseeme]16-Feb-06 5:24 
QuestionStream Reading & Multibyte encoding. Pin
liRetro16-Feb-06 5:16
liRetro16-Feb-06 5:16 
AnswerRe: Stream Reading & Multibyte encoding. Pin
User 665816-Feb-06 5:48
User 665816-Feb-06 5:48 
GeneralRe: Stream Reading & Multibyte encoding. Pin
liRetro16-Feb-06 8:04
liRetro16-Feb-06 8:04 
QuestionProperties in a property grid Pin
Mark_Harrison16-Feb-06 4:44
Mark_Harrison16-Feb-06 4:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.