Click here to Skip to main content
15,886,110 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Choosing an IPC mechanism Pin
Randor 5-May-09 6:54
professional Randor 5-May-09 6:54 
GeneralRe: Choosing an IPC mechanism Pin
Rajesh R Subramanian6-May-09 1:34
professionalRajesh R Subramanian6-May-09 1:34 
QuestionDLL performance during the day? Pin
Chesnokov Yuriy5-May-09 0:40
professionalChesnokov Yuriy5-May-09 0:40 
AnswerRe: DLL performance during the day? Pin
CPallini5-May-09 1:45
mveCPallini5-May-09 1:45 
JokeRe: DLL performance during the day? Pin
Rajesh R Subramanian5-May-09 1:54
professionalRajesh R Subramanian5-May-09 1:54 
GeneralRe: DLL performance during the day? Pin
CPallini5-May-09 2:27
mveCPallini5-May-09 2:27 
AnswerRe: DLL performance during the day? Pin
Randor 5-May-09 5:36
professional Randor 5-May-09 5:36 
QuestionCleint Server - Connection refused. Pin
ganesh.dp4-May-09 23:27
ganesh.dp4-May-09 23:27 
I made one simple client server program.
Server Socket created without any error but client program returns WSAECONNREFUSED error.

For one confirmation i create another one server socket with same port at that time it's not gives any error.
I get confused because it creates two sockets for same port without any error. But this also client gives same error

please help me to get out from this issue.

Server:


m_pserversock = new CServerSocket(this);
	bsucessflag= m_pserversock->Create(m_portno,SOCK_STREAM,NULL);
	status=m_pserversock->GetLastError();
	if(bsucessflag)
	{
		// TODO: Server Listen
		bsucessflag= m_pserversock->Listen(5);
		if(bsucessflag)
		{
			//CString Stemp = m_display.GetWindowText(Stemp,m_display.get
			m_display.SetWindowText("Server Listening\r\n");
		}
		else
		{
			m_display.SetWindowText("Unable to Listen\r\n");
			OnDisconnect();
		}
		int a=m_pserversock->m_hSocket;
	}
	else AfxMessageBox("Unable to Create");

        CSocket *temp;
	temp = new CSocket;
	bsucessflag=temp->Create(m_portno+1,SOCK_STREAM,NULL);
	if(!bsucessflag)
		AfxMessageBox("Error");




CServerSocket,CClientsock is from CSocket.

Client:


m_pClientsock = new CClientsock(this);
		if(m_pClientsock->Create())
		{
			if(m_pClientsock->Connect(dlg.m_Servername,dlg.m_Portno))
			{
				AfxMessageBox("Connected to Server");
				Init();
				m_bIsConnect = TRUE;
				m_Username = dlg.m_Username;
			}
			else 
			{
				int istatus=m_pClientsock->GetLastError();
				
				AfxMessageBox("Not able to Connect Server");
				delete m_pClientsock;
				m_pClientsock = NULL;
			}
		}
		else 
			AfxMessageBox("Not able to Create");	

QuestionMFC Pin
p_19604-May-09 23:17
p_19604-May-09 23:17 
AnswerRe: MFC Pin
Rajesh R Subramanian4-May-09 23:20
professionalRajesh R Subramanian4-May-09 23:20 
GeneralRe: MFC Pin
p_19604-May-09 23:32
p_19604-May-09 23:32 
GeneralRe: MFC Pin
Rajesh R Subramanian4-May-09 23:36
professionalRajesh R Subramanian4-May-09 23:36 
AnswerRe: MFC Pin
Chandrasekharan P4-May-09 23:23
Chandrasekharan P4-May-09 23:23 
GeneralBad answer! Pin
Rajesh R Subramanian4-May-09 23:26
professionalRajesh R Subramanian4-May-09 23:26 
GeneralRe: Bad answer! Pin
Chandrasekharan P4-May-09 23:29
Chandrasekharan P4-May-09 23:29 
GeneralRe: Bad answer! Pin
Cedric Moonen4-May-09 23:31
Cedric Moonen4-May-09 23:31 
GeneralRe: Bad answer! Pin
CPallini4-May-09 23:35
mveCPallini4-May-09 23:35 
GeneralRe: Bad answer! Pin
Rajesh R Subramanian4-May-09 23:35
professionalRajesh R Subramanian4-May-09 23:35 
GeneralRe: Bad answer! Pin
Chandrasekharan P4-May-09 23:38
Chandrasekharan P4-May-09 23:38 
AnswerRe: MFC Pin
_AnsHUMAN_ 5-May-09 0:00
_AnsHUMAN_ 5-May-09 0:00 
GeneralRe: MFC Pin
Rajesh R Subramanian5-May-09 0:32
professionalRajesh R Subramanian5-May-09 0:32 
GeneralRe: MFC Pin
_AnsHUMAN_ 5-May-09 1:15
_AnsHUMAN_ 5-May-09 1:15 
GeneralRe: MFC Pin
Rajesh R Subramanian5-May-09 1:32
professionalRajesh R Subramanian5-May-09 1:32 
GeneralRe: MFC Pin
_AnsHUMAN_ 5-May-09 1:32
_AnsHUMAN_ 5-May-09 1:32 
AnswerRe: MFC Pin
bob169725-May-09 2:12
bob169725-May-09 2:12 

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.