Click here to Skip to main content
15,892,697 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCompilation from script Pin
Anonymous6-Mar-05 3:31
Anonymous6-Mar-05 3:31 
Generaltray icons disappearing Pin
Kevin Tambascio6-Mar-05 3:09
Kevin Tambascio6-Mar-05 3:09 
GeneralCListCtrl Pin
super_pointer6-Mar-05 2:38
super_pointer6-Mar-05 2:38 
GeneralRe: CListCtrl Pin
PJ Arends6-Mar-05 12:26
professionalPJ Arends6-Mar-05 12:26 
GeneralRe: CListCtrl Pin
super_pointer6-Mar-05 14:58
super_pointer6-Mar-05 14:58 
GeneralRe: CListCtrl Pin
PJ Arends6-Mar-05 16:29
professionalPJ Arends6-Mar-05 16:29 
GeneralRe: CListCtrl Pin
ThatsAlok6-Mar-05 19:55
ThatsAlok6-Mar-05 19:55 
GeneralNon blocking socket problem Pin
eli150219796-Mar-05 0:54
eli150219796-Mar-05 0:54 
Hi,
I'm trying to set up multycast connection between few PC's.
The problem is that after the client send the data (let's say - "hello world")
at the first time,select() ans accept() are blocking my apllication,until the clinet tryies to connect again.
I was told to try to setup the socket to non blocking mode,using the ioctlsocket() and i tried this:

For each listening port,i call this function:
SOCKET CMultycast_serverDlg::CreateTCPServerSocket(int PortNumber)
{
	// this function create a socket for each port
	int Socket = 0;                  /* socket to create */
    struct sockaddr_in echoServAddr; /* Local address    */
    int bind_res;
    WSADATA wsaData;
	CString string;
	unsigned long argp = 1;

    if(WSAStartup(0x202,&wsaData) == SOCKET_ERROR)
	{
		AfxMessageBox(" Error :  WSAStartup() has failed   ");
		return -1;
	}

    /*==== Create socket for incoming connections ====*/
	Socket = socket(PF_INET,SOCK_STREAM,IPPROTO_TCP);
	if(Socket == INVALID_SOCKET)
	{
		string.Format("  Unable to create socket for port #%d  ",PortNumber);
		AfxMessageBox(string);
		return -1;
	}

 	ioctlsocket(Socket , FIONBIO , &argp);
   /*==== Construct local address structure ====*/
	memset(&echoServAddr,0,sizeof(echoServAddr));           //zero out structure
	echoServAddr.sin_family=AF_INET;                        //internet address family
	echoServAddr.sin_addr.S_un.S_addr=htonl(INADDR_ANY);    //any incoming inteface
	echoServAddr.sin_port=htons(PortNumber);                //local address
    
    /*==== bind to the local address ====*/
	bind_res = bind(Socket,(struct sockaddr*)&echoServAddr,sizeof(echoServAddr));
	if(bind_res == SOCKET_ERROR)
	{
		string.Format("  Unable to create bind to local address for port #%d  ",PortNumber);
		AfxMessageBox(string);
		return -1;
	}

	/*==== mark the socket so it will listen for incoming connections ====*/
	if(listen(Socket,MAXPENDING) == SOCKET_ERROR)
	{
		string.Format("  Unable to listen to socket in port #%d  ",PortNumber);
		AfxMessageBox(string);
		return -1;
	}

	return Socket;
}


But the problem still appear.
Is there any toturial about this problem?

With best regards.
Eli
GeneralRe: Non blocking socket problem Pin
Mike Dimmick6-Mar-05 1:39
Mike Dimmick6-Mar-05 1:39 
Generalresponses will be Rendering Page Flip effect Pin
Shahzaib Saleem6-Mar-05 0:54
Shahzaib Saleem6-Mar-05 0:54 
QuestionHow to use compiled help in VS NET? Pin
IlanTal6-Mar-05 0:30
IlanTal6-Mar-05 0:30 
AnswerRe: How to use compiled help in VS NET? Pin
Mike Dimmick6-Mar-05 1:47
Mike Dimmick6-Mar-05 1:47 
GeneralRe: How to use compiled help in VS NET? Pin
IlanTal6-Mar-05 18:20
IlanTal6-Mar-05 18:20 
GeneralPassing parameters to CreateThread() Pin
Nikhil Wason5-Mar-05 19:29
Nikhil Wason5-Mar-05 19:29 
GeneralRe: Passing parameters to CreateThread() Pin
Lim Bio Liong5-Mar-05 22:42
Lim Bio Liong5-Mar-05 22:42 
GeneralRe: Passing parameters to CreateThread() Pin
Lim Bio Liong5-Mar-05 22:50
Lim Bio Liong5-Mar-05 22:50 
GeneralRe: Passing parameters to CreateThread() Pin
Michael Dunn6-Mar-05 4:24
sitebuilderMichael Dunn6-Mar-05 4:24 
GeneralMFC & GDI+ Pin
Chis MU5-Mar-05 16:20
Chis MU5-Mar-05 16:20 
Generalplease I need help Pin
waway5-Mar-05 14:05
waway5-Mar-05 14:05 
GeneralRe: please I need help Pin
Ravi Bhavnani6-Mar-05 12:32
professionalRavi Bhavnani6-Mar-05 12:32 
GeneralProtection error: debugger detected Pin
aritosteles5-Mar-05 14:05
aritosteles5-Mar-05 14:05 
GeneralRe: Protection error: debugger detected Pin
aritosteles14-Mar-05 17:14
aritosteles14-Mar-05 17:14 
GeneralRe: Protection error: debugger detected Pin
Dave Midgley25-Feb-11 23:40
Dave Midgley25-Feb-11 23:40 
GeneralUsing Visual Basic 6 dll in Visual C++ 6 Pin
Kumarunster5-Mar-05 10:45
Kumarunster5-Mar-05 10:45 
GeneralRe: Using Visual Basic 6 dll in Visual C++ 6 Pin
Mike Dimmick5-Mar-05 12:51
Mike Dimmick5-Mar-05 12:51 

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.