|
Can you give me a few examples that makes you think linux is more secure?
|
|
|
|
|
Hey «_Superman_»,
Actually it's my thinking.I am using currently both XP and Linux.But as my exeperience says that WindowsXP is a homw of viruses and Linux not.And cracking Linux login password is much more difficult than Windows.and more...
|
|
|
|
|
Having gone through your "latest queries", it appears to me that reading a beginners tutorial on socket programming might do you good. I'd do it if I were you.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Additional to what was said before, take a look at Beej's guide to networking programming[^]. It is an excellent starting point for network programming and may answer a lot of questions.
Hope it helps, if you liked/disliked the link let me know.
|
|
|
|
|
Hi all,
I am developing an application using VC6.
My application uses MCIWnd to play videos.
I am now trying support FLV and MP4 videos.
I go with a codec.
After install K-lite codec, I rename the MP4 and FLV videos into .wmv files. They work.
However, when I play these videos with their own file names (in MP4 and FLV extensions), I get an error "The specified file cannot be played on the specified MCI device..."
It happens when I call the MCIWndOpen function.
I understand that this function considers the file names instead of video headers to determine video formats.
Of course naming all FLV and MP4 videos into .wmv should not be a choice.
Any suggestion for me please?
Thanks,
TuanVo.
|
|
|
|
|
Hello,
i need to create an array with a certain size, the value is stored in an integer (not constant) but for some reason i am unable to initialize an array with the following code:
int size = someclass.somefunction.somevalue;
int buffer[size];
Why cant i initialize it like this?
TY
|
|
|
|
|
yeah1000 wrote: Why cant i initialize it like this?
Because the value is unknown at compile time.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
How about this:
int size = someclass.somefunction.somevalue;
PINT buffer = new int[size];
...
...
...
...
delete[] buffer;
|
|
|
|
|
Hi,
If I double click an exe which is in a DVD and if I remove the DVD how long the exe will be in the systems"s memory.....in XP,server 2003,2008,Vista
|
|
|
|
|
It will stay in memory until the application is terminated or exited. This could be milliseconds, seconds, minutes, hours, days, weeks, months, years, decades, centuries or milleniums.
If you access a resource in the executable with the DVD removed your operating system will probably complain.
Best Wishes,
-David Delaune
|
|
|
|
|
The EXE is not completely loaded into the memory.
Only portions that are currently executing and are likely to execute later are stored.
So it will depend on the amount of memory you have and the nature of the executing program.
|
|
|
|
|
Hi,
I want to send binary file through Sockets in WindowsXP from server to client.My code is-
client:
hFile=CreateFileA(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
if (hFile == NULL || hFile == INVALID_HANDLE_VALUE)
{
hFile = NULL;
}
for (i=0 ; ; )
{
j=recv(sock, buf, sizeof(buf), 0);
printf("\n\treceiving file...plz wait.");
if (j <= 0)
break;
i += j;
WriteFile(hFile, buf, j, &dw, 0);
}
CloseHandle(hFile);
printf("\n\tfile received sucessfully");
server:
fp=fopen(pathoffile,"rb");
if(fp==NULL)
{
printf("\ncann't open file");
}
for (i=0, endoffile=0 ; ; )
{
j = fread(buf, 1, sizeof(buf), fp);
if (j < 0)
{
}
if (j == 0)
{
endoffile = 1;
}
j=send(TheClient, buf, j, 0);
}
The code is compiled properly but when i want to receive any file.the file received sucessfully.I was thinking that it should be printed on client computer "file received sucessfully" but it is printed only when i close my server.When the server is executing at the receving time it is printed "receiving file...plz wait." yet the file already sucessfully received on client side.
|
|
|
|
|
ravi 12 wrote: When the server is executing at the receving time it is printed "receiving file...plz wait." yet the file already sucessfully received on client side.
The client side code will continue to attempt to receive data even after the end of the file, as you do not tell the client that there is no more data. As long as the socket remains open the client will try and read from it. You need to send a message from the server to indicate EOF and then the client and server should both close their connections.
|
|
|
|
|
Thanks Richard MacCutchan........
|
|
|
|
|
Hey Richard MacCutchan,
Can you please tell me how to achive this ?Actually i am little bit in confuse related to this topic.
|
|
|
|
|
WindowsVsLinux wrote: Can you please tell me how to achive this ?Actually i am little bit in confuse related to this topic.
Sorry, but I am not sure what you are asking. My suggestion to the original poster was quite simple: when the server gets end-of-file on the data file he should send a special message to the client which the client understands as 'no more data'. Both sides should then close their socket connections.
I don't know whether you are using Windows or Linux, but you will find that socckets are broadly the same on both platforms. Lots of good information on MSDN, here and other sites. Use Google to find tutorials and samples.
|
|
|
|
|
Hey Richard MacCutchan,
Can you please tell me how to achive this? Actually i am little bit in confuse related to this topic.
|
|
|
|
|
I suppose your recv is a blocking call (that's the default behaviour of sockets).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
you should signal the client that all data is sended:
shutdown( m_sock, SD_SEND );
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi,
I want to ask you that how to clear all the elements of an char array.Can i use strcpy(array.""); for this purpose? or can i do linke this array[0]='\0' to delete all the elements
|
|
|
|
|
if you need to clear the whole array then you've to do something like
(I assume it is an array of char s)
char foo[]="foo";
memset(foo, '\0', sizeof(foo));
Setting
foo[0]='\0'; is just a shortcut to have a zero-terminated empty string (plus some garbage) into the array, i.e.
char foo[]="foo";
foo[0]='\0';
printf("%s\n", foo); will output a blank line.
Anyway (and of course) the array content isn't all erased (namely foo[]={'\0', 'o', 'o' }; )
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Aren't you just wanting to initialise the array elements to zero? See ZeroMemory[^] and SecureZeroMemory[^].
ravi 12 wrote: array[0]='\0' to delete all the elements
That won't "delete" the elements of an array.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
i use
char buff[200] = {0};
to initialize a buffer. or memset( buff, 0 sizeof(buff) );
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Comma missing.
Charles the Nitpick.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Charles the Nitpick. Rhinotillexomaniac
FTFY
Best Wishes,
-David Delaune
|
|
|
|