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

C / C++ / MFC

 
GeneralRe: random number Pin
David Crow31-Mar-04 2:21
David Crow31-Mar-04 2:21 
GeneralRe: random number Pin
Paul Ranson31-Mar-04 2:20
Paul Ranson31-Mar-04 2:20 
GeneralRe: random number Pin
Tim Smith31-Mar-04 3:57
Tim Smith31-Mar-04 3:57 
GeneralRe: random number Pin
Paul Ranson31-Mar-04 4:20
Paul Ranson31-Mar-04 4:20 
Generalmpeg streamer Pin
Florin Ochiana30-Mar-04 22:10
Florin Ochiana30-Mar-04 22:10 
GeneralDirectInput Gamepad axes name localization.... Pin
haust30-Mar-04 21:59
haust30-Mar-04 21:59 
Generalabout socket Pin
Member 98096830-Mar-04 21:32
Member 98096830-Mar-04 21:32 
GeneralRe: about socket Pin
Antony M Kancidrowski31-Mar-04 0:24
Antony M Kancidrowski31-Mar-04 0:24 
Here is an example that will wait upto 5 seconds for a reply

struct timeval	tv;
fd_set		set;
int		xfd;

// Timeout
tv.tv_sec = 5;
tv.tv_usec = 0;
		
FD_ZERO(&set);
FD_SET(Socket, &set);

if ((xfd = select(Socket + 1, &set, NULL, NULL, &tv)) == SOCKET_ERROR)
{
    // Error
}

// Wait upto timeout for data to arrive on the socket		
if (FD_ISSET(Socket, &set))
{
    char RxBuff[1024];

    recv(Socket, RxBuff, 1024, 0);
}


Note that the first parameter for select is ignored, i.e. Socket + 1 is just so I know what the select is for!
Ant.
GeneralForm view problem Pin
Raghunandan S30-Mar-04 21:19
Raghunandan S30-Mar-04 21:19 
GeneralRe: Form view problem Pin
Antti Keskinen30-Mar-04 21:34
Antti Keskinen30-Mar-04 21:34 
QuestionHow to replicate a directory? Pin
RickardIsraelsson30-Mar-04 21:07
RickardIsraelsson30-Mar-04 21:07 
AnswerRe: How to replicate a directory? Pin
David Crow31-Mar-04 2:25
David Crow31-Mar-04 2:25 
GeneralCTreeView Pin
fbachan30-Mar-04 21:03
fbachan30-Mar-04 21:03 
GeneralRe: CTreeView Pin
ohadp30-Mar-04 21:36
ohadp30-Mar-04 21:36 
GeneralCopy of Array of Bytes Pin
JeabJB30-Mar-04 21:03
JeabJB30-Mar-04 21:03 
GeneralRe: Copy of Array of Bytes Pin
ohadp30-Mar-04 21:34
ohadp30-Mar-04 21:34 
GeneralRe: Copy of Array of Bytes Pin
JeabJB30-Mar-04 23:04
JeabJB30-Mar-04 23:04 
GeneralRe: Copy of Array of Bytes Pin
David Crow31-Mar-04 2:31
David Crow31-Mar-04 2:31 
QuestionWhat is "Visual Studio (MSI)"? Pin
Vasiliy Baranov30-Mar-04 20:50
Vasiliy Baranov30-Mar-04 20:50 
AnswerRe: What is "Visual Studio (MSI)"? Pin
Colin Angus Mackay30-Mar-04 21:45
Colin Angus Mackay30-Mar-04 21:45 
GeneralRe: What is "Visual Studio (MSI)"? Pin
Vasiliy Baranov30-Mar-04 22:00
Vasiliy Baranov30-Mar-04 22:00 
AnswerRe: What is "Visual Studio (MSI)"? Pin
David Crow31-Mar-04 2:34
David Crow31-Mar-04 2:34 
GeneralInclude headers. Pin
Neha30-Mar-04 20:24
Neha30-Mar-04 20:24 
GeneralRe: Include headers. Pin
Prakash Nadar30-Mar-04 20:30
Prakash Nadar30-Mar-04 20:30 
GeneralRe: Include headers. Pin
Neha30-Mar-04 20:44
Neha30-Mar-04 20:44 

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.