Click here to Skip to main content
15,914,342 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Winsock Source Code for VC++ 6.0 Pin
Alexander M.,28-Aug-03 10:55
Alexander M.,28-Aug-03 10:55 
GeneralRe: Winsock Source Code for VC++ 6.0 Pin
Johnny_Uta28-Aug-03 13:35
Johnny_Uta28-Aug-03 13:35 
GeneralRe: Winsock Source Code for VC++ 6.0 Pin
Alexander M.,28-Aug-03 15:20
Alexander M.,28-Aug-03 15:20 
GeneralRe: Winsock Source Code for VC++ 6.0 Pin
Johnny_Uta28-Aug-03 18:27
Johnny_Uta28-Aug-03 18:27 
GeneralRe: Winsock Source Code for VC++ 6.0 Pin
palbano29-Aug-03 5:55
palbano29-Aug-03 5:55 
GeneralRe: Winsock Source Code for VC++ 6.0 Pin
Steve S28-Aug-03 22:46
Steve S28-Aug-03 22:46 
GeneralRe: Winsock Source Code for VC++ 6.0 Pin
palbano29-Aug-03 5:53
palbano29-Aug-03 5:53 
GeneralRe: Winsock Source Code for VC++ 6.0 Pin
Johnny_Uta29-Aug-03 8:40
Johnny_Uta29-Aug-03 8:40 
This is exactly what i was looking for

int socket = -1;

//****************************************************************
// ManageSocket
// Call this function every sec
//****************************************************************

void ManageSocket ()
{
fd_set ready;
struct timeval to;

//Check if the connection is active
if (socket > 0 )
{
FD_ZERO(&ready);
FD_SET(socket, &ready);
to.tv_sec = 0;
to.tv_usec = 1;

select(socket + 1, &ready, 0, 0, &to)

if (FD_ISSET(sock, &ready)) //If socket ready
{
//Packet with a size of zero = Connection closed
if ( recv ( sock , buf , 1024 , 0) == 0)
{
//Closing the socket
close(socket);
socket = -1;
}
}
}
// When Connection is inactive client will try to reconnect every sec
else if (Socket < 0)
{
//Reconnect to the host
}
}
QuestionHow to get a pointer to CView class from CMainFrame class Pin
mr200328-Aug-03 8:36
mr200328-Aug-03 8:36 
AnswerRe: How to get a pointer to CView class from CMainFrame class Pin
Swinefeaster28-Aug-03 8:39
Swinefeaster28-Aug-03 8:39 
GeneralRe: How to get a pointer to CView class from CMainFrame class Pin
mr200328-Aug-03 9:00
mr200328-Aug-03 9:00 
GeneralRe: How to get a pointer to CView class from CMainFrame class Pin
Michael P Butler28-Aug-03 9:04
Michael P Butler28-Aug-03 9:04 
GeneralRe: How to get a pointer to CView class from CMainFrame class Pin
Swinefeaster28-Aug-03 9:04
Swinefeaster28-Aug-03 9:04 
AnswerRe: How to get a pointer to CView class from CMainFrame class Pin
Rage28-Aug-03 8:40
professionalRage28-Aug-03 8:40 
GeneralRe: How to get a pointer to CView class from CMainFrame class Pin
Bob Stanneveld29-Aug-03 4:28
Bob Stanneveld29-Aug-03 4:28 
GeneralBrowser Information Callers Graph Pin
palbano28-Aug-03 8:21
palbano28-Aug-03 8:21 
GeneralRe: Browser Information Callers Graph Pin
Alexander M.,28-Aug-03 10:56
Alexander M.,28-Aug-03 10:56 
GeneralRe: Browser Information Callers Graph Pin
palbano29-Aug-03 5:44
palbano29-Aug-03 5:44 
Generalproblem with a dll Pin
Anonymous28-Aug-03 8:18
Anonymous28-Aug-03 8:18 
GeneralRe: problem with a dll Pin
User 665828-Aug-03 8:36
User 665828-Aug-03 8:36 
GeneralRe: problem with a dll Pin
David Crow28-Aug-03 10:23
David Crow28-Aug-03 10:23 
Generalsolution! Pin
Alexander M.,28-Aug-03 11:00
Alexander M.,28-Aug-03 11:00 
GeneralRe: solution! Pin
Anonymous28-Aug-03 11:30
Anonymous28-Aug-03 11:30 
GeneralRe: solution! Pin
Alexander M.,28-Aug-03 12:42
Alexander M.,28-Aug-03 12:42 
GeneralRe: solution! Pin
Antti Keskinen29-Aug-03 9:13
Antti Keskinen29-Aug-03 9:13 

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.