Click here to Skip to main content
15,900,906 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# abstract class Pin
Vikram A Punathambekar31-Mar-08 22:35
Vikram A Punathambekar31-Mar-08 22:35 
GeneralRe: C# abstract class Pin
Eduard Keilholz31-Mar-08 23:54
Eduard Keilholz31-Mar-08 23:54 
GeneralRaising event from an user control Pin
narayanagvs31-Mar-08 21:31
narayanagvs31-Mar-08 21:31 
GeneralWebbrowser component Pin
bdiepeveen31-Mar-08 21:07
bdiepeveen31-Mar-08 21:07 
GeneralRe: Webbrowser component Pin
Aditya Baraya31-Mar-08 21:55
Aditya Baraya31-Mar-08 21:55 
GeneralRe: Webbrowser component Pin
bdiepeveen31-Mar-08 22:54
bdiepeveen31-Mar-08 22:54 
QuestionImage Processing Lab Doubt Pin
billaprem31-Mar-08 20:13
billaprem31-Mar-08 20:13 
QuestionWaking a thread.. Pin
ptr2void31-Mar-08 20:06
ptr2void31-Mar-08 20:06 
GeneralRe: Waking a thread.. Pin
K.L.K7-Apr-08 14:35
K.L.K7-Apr-08 14:35 
QuestionCheck digit calculation Pin
D i x y31-Mar-08 19:59
D i x y31-Mar-08 19:59 
GeneralRe: Check digit calculation Pin
Eduard Keilholz31-Mar-08 21:09
Eduard Keilholz31-Mar-08 21:09 
QuestionProblem while uploading file on FTP server Pin
pavya_Cool31-Mar-08 19:50
pavya_Cool31-Mar-08 19:50 
AnswerRe: Problem while uploading file on FTP server Pin
JABIR E14-May-08 20:21
JABIR E14-May-08 20:21 
GeneralPass Arguments to Button Click event Pin
karthik_dotnet131-Mar-08 19:18
karthik_dotnet131-Mar-08 19:18 
Questionhow to import GIF file into datagrid Pin
palanirajan31-Mar-08 18:15
palanirajan31-Mar-08 18:15 
QuestionBuilding a pc remote control? Pin
Goalie3531-Mar-08 17:18
Goalie3531-Mar-08 17:18 
GeneralI'm confused about Sockets again... Pin
Jordanwb31-Mar-08 15:50
Jordanwb31-Mar-08 15:50 
... and I'm not afraid to admit. I thought I understood how they work but I guess I was wrong. So can you tell me if my understanding is correct.

Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);<br />
s.Bind(new IPEndPoint(IPAddress.Parse("192.168.1.3"), 37));<br />


I don't have a problem with that, I understand protocols.

s.Listen(6); This means that the socket lets 6 clients connect to this socket to establish a connection. This socket isn't actually used to send/receive data (except under the surface).

This is the OnAccept Callback:
<br />
public void Accept(IAsyncResult ar)<br />
        {<br />
            Socket new_socket = s.EndAccept(ar);<br />
<br />
            s.BeginAccept(new AsyncCallback(Accept), s);<br />
        }<br />


s.EndAccept (ar) returns a new socket which you would use as a connection between host and client. new_socket and s are two seperate sockets. s.BeginAccept(new AsyncCallback(Accept), s) then tells the socket to begin accepting a new client. Now when I want to disconnect the host would do:

new_socket.BeginDisconnect(false, new AsyncCallback(OnDisconnect), s);

But I don't know what to do in the callback. I know there is Shutdown and Disconnect but I don't know where and on which end to do this.

Any helps would be greatly appreciated.
QuestionVisually comparing filestreams/strings Pin
testdi31-Mar-08 13:00
testdi31-Mar-08 13:00 
GeneralIEdge cant be an IEdge Pin
Gareth H31-Mar-08 10:30
Gareth H31-Mar-08 10:30 
GeneralRe: IEdge cant be an IEdge Pin
led mike31-Mar-08 10:44
led mike31-Mar-08 10:44 
QuestionButton Click event with "RenderControl" Pin
wagswvu31-Mar-08 10:13
wagswvu31-Mar-08 10:13 
GeneralRe: Button Click event with "RenderControl" Pin
Jesse Squire31-Mar-08 11:22
Jesse Squire31-Mar-08 11:22 
GeneralRe: Button Click event with "RenderControl" Pin
wagswvu31-Mar-08 11:46
wagswvu31-Mar-08 11:46 
GeneralRe: Button Click event with "RenderControl" Pin
Jesse Squire31-Mar-08 12:44
Jesse Squire31-Mar-08 12:44 
GeneralPopulation dropdown menu on keyboard navigation Pin
AndrusM31-Mar-08 7:10
AndrusM31-Mar-08 7:10 

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.