Click here to Skip to main content
15,921,203 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalhooking Pin
gamitech27-Nov-04 11:15
gamitech27-Nov-04 11:15 
GeneralRe: hooking Pin
John R. Shaw27-Nov-04 17:26
John R. Shaw27-Nov-04 17:26 
GeneralRe: hooking Pin
Roger Allen29-Nov-04 2:34
Roger Allen29-Nov-04 2:34 
QuestionEz ? Pin
BaldwinMartin27-Nov-04 11:07
BaldwinMartin27-Nov-04 11:07 
AnswerRe: Ez ? Pin
John R. Shaw27-Nov-04 17:04
John R. Shaw27-Nov-04 17:04 
GeneralWinsock Problem/Question Pin
pshopaddict27-Nov-04 8:18
susspshopaddict27-Nov-04 8:18 
GeneralRe: Winsock Problem/Question Pin
John R. Shaw27-Nov-04 18:30
John R. Shaw27-Nov-04 18:30 
GeneralRe: Winsock Problem/Question Pin
pshopaddict27-Nov-04 20:10
susspshopaddict27-Nov-04 20:10 
///this is just a part of the code its kinda messy i just starting to learn c++/winapi.

SOCKET m_socket[chatter];

else if(msg==WM_SOCKET)
{

switch(WSAGETSELECTEVENT(lParam))
{
case FD_ACCEPT:
char socknum[30];
sprintf(socknum,"%d",sock);
strcat(socknum,"Connection Detected on socket ");
SendtoChat(socknum);
m_socket[sock]=accept(m_socket[0],NULL,NULL);

sock++;
break;

case FD_CLOSE:
SendtoChat("Closing Detected");
//closesocket(m_socket[1]);
break;
case FD_READ:
char str[1000];
memset(str,0,1000);int ctr=1;
while(ctr!=chatter)
{
recv(m_socket[ctr],str,sizeof(str),0);
ctr++;
}
ctr=1;
while(ctr!=chatter)
{
if(send(m_socket[ctr],str,sizeof(str),0)==SOCKET_ERROR)
{

}
ctr++;
}
SendtoChat(str);
//MessageBox(hwnd,str,"",MB_OK);
//free(str);
break;
}


--------

What i want to do is evrytime someone disconnects.. i wanna know which socket got the disconnection... so when soemone try to request connection i will know which index is available for connection and so i could give that index to the connection requesting.... i can just make a loop until it doesnt get an error to see if someone is connected to it or not but then i dont want it to be unorganized.... and another thing sometimes port scanners connects to a winsock program and fools the program for a legitimate connection so i want it to be more organize so i will know whch connection is legitimate or not

Maybe, is there a way to know if someone is connected to one socket?

I have no idea
GeneralRe: Winsock Problem/Question Pin
Anders Molin28-Nov-04 6:22
professionalAnders Molin28-Nov-04 6:22 
GeneralRe: Winsock Problem/Question Pin
John R. Shaw28-Nov-04 8:34
John R. Shaw28-Nov-04 8:34 
GeneralRe: Winsock Problem/Question Pin
pshopaddict29-Nov-04 5:21
susspshopaddict29-Nov-04 5:21 
Questionhow to run .exe with .dll Pin
Member 154670927-Nov-04 6:58
Member 154670927-Nov-04 6:58 
AnswerRe: how to run .exe with .dll Pin
gamitech27-Nov-04 11:02
gamitech27-Nov-04 11:02 
QuestionMDI VC++, How to pass parameters to view? Pin
wwwrabbit127-Nov-04 6:08
susswwwrabbit127-Nov-04 6:08 
AnswerRe: MDI VC++, How to pass parameters to view? Pin
John R. Shaw27-Nov-04 6:55
John R. Shaw27-Nov-04 6:55 
GeneralRe: MDI VC++, How to pass parameters to view? Pin
david_gilmour27-Nov-04 13:05
david_gilmour27-Nov-04 13:05 
GeneralRe: MDI VC++, How to pass parameters to view? Pin
John R. Shaw27-Nov-04 16:53
John R. Shaw27-Nov-04 16:53 
QuestionHow can a DLL execute a function of the main app? Pin
Dominik Reichl27-Nov-04 5:22
Dominik Reichl27-Nov-04 5:22 
AnswerRe: How can a DLL execute a function of the main app? Pin
peterchen27-Nov-04 5:47
peterchen27-Nov-04 5:47 
General? Re: How can a DLL execute a function of the main app? ? Pin
Dominik Reichl27-Nov-04 5:56
Dominik Reichl27-Nov-04 5:56 
GeneralRe: ? Re: How can a DLL execute a function of the main app? ? Pin
John R. Shaw27-Nov-04 19:04
John R. Shaw27-Nov-04 19:04 
General? Re: ? Re: How can a DLL execute a function of the main app? ? ? Pin
Dominik Reichl27-Nov-04 23:00
Dominik Reichl27-Nov-04 23:00 
GeneralRe: ? Re: ? Re: How can a DLL execute a function of the main app? ? ? Pin
Neville Franks28-Nov-04 0:43
Neville Franks28-Nov-04 0:43 
GeneralRe: ? Re: ? Re: How can a DLL execute a function of the main app? ? ? Pin
Dominik Reichl28-Nov-04 1:50
Dominik Reichl28-Nov-04 1:50 
GeneralRe: ? Re: ? Re: How can a DLL execute a function of the main app? ? ? Pin
John R. Shaw28-Nov-04 8:08
John R. Shaw28-Nov-04 8: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.