Click here to Skip to main content
15,891,513 members
Home / Discussions / C#
   

C#

 
Questionexisting object.custom property Pin
_Q12_29-Jul-09 4:19
_Q12_29-Jul-09 4:19 
AnswerRe: existing object.custom property Pin
OriginalGriff29-Jul-09 4:30
mveOriginalGriff29-Jul-09 4:30 
AnswerRe: existing object.custom property Pin
_Q12_29-Jul-09 6:32
_Q12_29-Jul-09 6:32 
QuestionRouge Text String in Socket Programing Pin
User 621557929-Jul-09 4:04
User 621557929-Jul-09 4:04 
AnswerRe: Rouge Text String in Socket Programing Pin
Nagy Vilmos29-Jul-09 4:59
professionalNagy Vilmos29-Jul-09 4:59 
GeneralRe: Rouge Text String in Socket Programing Pin
User 621557929-Jul-09 5:09
User 621557929-Jul-09 5:09 
GeneralRe: Rouge Text String in Socket Programing Pin
Nagy Vilmos29-Jul-09 5:12
professionalNagy Vilmos29-Jul-09 5:12 
GeneralRe: Rouge Text String in Socket Programing Pin
User 621557929-Jul-09 6:21
User 621557929-Jul-09 6:21 
Okay fixed the part about the changing names while server is live but still have the problem of it trying to receive data from a socket that is closed, which it shouldn't do but does anyway just to spite me.

This is the code to closing the socket (Server Side)
string msg = "Name Taken";
byte[] byData = System.Text.Encoding.Default.GetBytes(msg);
socketData.m_currentSocket.Send(byData);
socketData.m_currentSocket.Close();
m_workerSocketList.Remove(socketData.m_currentSocket);
m_clientCount--;


This is the code where is error happens (Server Side):
try
            {
                if (pfnWorkerCallBack == null)
                {
                    // Specify the call back function which is to be 
                    // invoked when there is any write activity by the 
                    // connected client
                    pfnWorkerCallBack = new AsyncCallback(OnDataReceived);
                }
                SocketPacket theSocPkt = new SocketPacket(soc, clientNumber);

                soc.BeginReceive(theSocPkt.dataBuffer, 0, theSocPkt.dataBuffer.Length, SocketFlags.None, pfnWorkerCallBack, theSocPkt);
            }
            catch (Exception se)
            {
                MessageBox.Show(se.Message);
            }


And last bit the client does when it is kicked:

if (m_clientSocket != null)
                        {
                            m_clientSocket.Close();
                            m_clientSocket = null;
                            UpdateControls(false);
                        }


Any ideas?

modified 27-Feb-21 21:01pm.

GeneralRe: Rouge Text String in Socket Programing Pin
Nagy Vilmos29-Jul-09 6:48
professionalNagy Vilmos29-Jul-09 6:48 
GeneralRe: Rouge Text String in Socket Programing Pin
User 621557929-Jul-09 6:55
User 621557929-Jul-09 6:55 
GeneralRe: Rouge Text String in Socket Programing Pin
Nagy Vilmos29-Jul-09 7:03
professionalNagy Vilmos29-Jul-09 7:03 
GeneralRe: Rouge Text String in Socket Programing Pin
User 621557929-Jul-09 7:11
User 621557929-Jul-09 7:11 
GeneralRe: Rouge Text String in Socket Programing Pin
Nagy Vilmos29-Jul-09 22:19
professionalNagy Vilmos29-Jul-09 22:19 
GeneralRe: Rouge Text String in Socket Programing Pin
User 621557930-Jul-09 1:54
User 621557930-Jul-09 1:54 
GeneralLogin form connectivity with SQL server 2005 with ADO.NET Pin
Harpreet Singh Matharoo29-Jul-09 4:03
Harpreet Singh Matharoo29-Jul-09 4:03 
GeneralRe: Login form connectivity with SQL server 2005 with ADO.NET Pin
Vimalsoft(Pty) Ltd29-Jul-09 4:50
professionalVimalsoft(Pty) Ltd29-Jul-09 4:50 
QuestionDatagridview DateTimePicker Problem. Pin
priyamtheone29-Jul-09 3:31
priyamtheone29-Jul-09 3:31 
QuestionFind Scroll bar moved either left/right? Pin
spalanivel29-Jul-09 3:15
spalanivel29-Jul-09 3:15 
AnswerRe: Find Scroll bar moved either left/right? Pin
Nagy Vilmos29-Jul-09 3:33
professionalNagy Vilmos29-Jul-09 3:33 
AnswerCP Please ignore Pin
leckey29-Jul-09 4:55
leckey29-Jul-09 4:55 
QuestionHow can i see native code? Pin
frommi29-Jul-09 3:10
frommi29-Jul-09 3:10 
AnswerRe: How can i see native code? Pin
MumbleB29-Jul-09 3:45
MumbleB29-Jul-09 3:45 
GeneralRe: How can i see native code? Pin
PIEBALDconsult29-Jul-09 7:03
mvePIEBALDconsult29-Jul-09 7:03 
AnswerRe: How can i see native code? Pin
Eddy Vluggen29-Jul-09 3:57
professionalEddy Vluggen29-Jul-09 3:57 
AnswerRe: How can i see native code? Pin
frommi29-Jul-09 4:08
frommi29-Jul-09 4:08 

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.