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

C#

 
AnswerRe: How to use COM components in .net application Pin
sarvesh.upadhyay24-Mar-08 1:28
professionalsarvesh.upadhyay24-Mar-08 1:28 
Generalkeyboard to xbox controller Pin
sakirah22-Mar-08 16:17
sakirah22-Mar-08 16:17 
GeneralRe: keyboard to xbox controller Pin
User 665823-Mar-08 3:32
User 665823-Mar-08 3:32 
GeneralCurrent sorted row in DGV Pin
baranils22-Mar-08 10:54
baranils22-Mar-08 10:54 
GeneralRe: Current sorted row in DGV Pin
Luc Pattyn22-Mar-08 14:02
sitebuilderLuc Pattyn22-Mar-08 14:02 
QuestionAccess Environment Variables: C# Pin
Yasithl22-Mar-08 10:26
Yasithl22-Mar-08 10:26 
GeneralRe: Access Environment Variables: C# Pin
Giorgi Dalakishvili22-Mar-08 10:52
mentorGiorgi Dalakishvili22-Mar-08 10:52 
GeneralQuestion about how Sockets work Pin
Jordanwb22-Mar-08 9:30
Jordanwb22-Mar-08 9:30 
I got a question about how sockets work it's kinda confusing.

public ServerConnection(IPAddress this_machine, UInt16 port)<br />
                    : base()<br />
                {<br />
                    this.init_connection = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);<br />
<br />
                    this.ip_end_point = new IPEndPoint(this_machine, (int)port);<br />
                    this.init_connection.Bind(this.ip_end_point);<br />
                    this.init_connection.Listen(2);<br />
<br />
                    this.init_connection.BeginAccept(new AsyncCallback(this.OnDataControlConnect), this.init_connection);<br />
                }<br />
<br />
                private void OnDataControlConnect(IAsyncResult ar)<br />
                {<br />
                    this.data_control = (Socket)ar.AsyncState;<br />
                    this.data_control.BeginReceive(this.data_control_buffer, 0, 4, SocketFlags.None, new AsyncCallback(this.OnDataControlReceive), this.data_control);<br />
<br />
                    this.init_connection.BeginAccept(new AsyncCallback(this.OnDataConnect), this.init_connection);<br />
                }


Now in the OnDataControlConnect method I cast the AsyncState method as a socket. Is the socket that was casted the same socket I passed in "this.init_connection.BeginAccept(new AsyncCallback(this.OnDataControlConnect), this.init_connection);"?

I hope I'm being clear enough I'm still trying to understand how sockets work.

Thanks.
GeneralRe: Question about how Sockets work Pin
Jordanwb22-Mar-08 15:50
Jordanwb22-Mar-08 15:50 
GeneralRe: Question about how Sockets work Pin
Shy Agam23-Mar-08 9:57
Shy Agam23-Mar-08 9:57 
GeneralRe: Question about how Sockets work [modified] Pin
Jordanwb23-Mar-08 12:44
Jordanwb23-Mar-08 12:44 
GeneralRe: Question about how Sockets work [modified] Pin
Jordanwb24-Mar-08 6:49
Jordanwb24-Mar-08 6:49 
QuestionChange text of messageBox buttons Pin
pcaeiro22-Mar-08 7:19
pcaeiro22-Mar-08 7:19 
GeneralRe: Change text of messageBox buttons Pin
Gareth H22-Mar-08 9:15
Gareth H22-Mar-08 9:15 
GeneralRe: Change text of messageBox buttons Pin
Giorgi Dalakishvili22-Mar-08 9:53
mentorGiorgi Dalakishvili22-Mar-08 9:53 
GeneralRe: Change text of messageBox buttons Pin
Pete O'Hanlon22-Mar-08 9:59
mvePete O'Hanlon22-Mar-08 9:59 
GeneralRe: Change text of messageBox buttons Pin
CPallini23-Mar-08 0:41
mveCPallini23-Mar-08 0:41 
GeneralRe: Change text of messageBox buttons Pin
pcaeiro23-Mar-08 1:42
pcaeiro23-Mar-08 1:42 
Questioncombo box moving and adding items. Pin
steve_rm22-Mar-08 7:15
steve_rm22-Mar-08 7:15 
QuestionSearching System Drive for a file Pin
md.mostafiz22-Mar-08 4:08
md.mostafiz22-Mar-08 4:08 
GeneralRe: Searching System Drive for a file Pin
Colin Angus Mackay22-Mar-08 4:18
Colin Angus Mackay22-Mar-08 4:18 
GeneralRe: Searching System Drive for a file Pin
MNFlyer22-Mar-08 4:19
MNFlyer22-Mar-08 4:19 
Generalusing this as synchronization object Pin
George_George22-Mar-08 3:52
George_George22-Mar-08 3:52 
GeneralRe: using this as synchronization object [modified] Pin
girm22-Mar-08 4:01
girm22-Mar-08 4:01 
GeneralRe: using this as synchronization object Pin
George_George22-Mar-08 4:03
George_George22-Mar-08 4:03 

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.