|
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
|
|
|
|
|
You should not disclose our little secrets...
BTW How long does an active process remain in memory if I unplug the power cable?
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: BTW How long does an active process remain in memory if I unplug the power cable?
Until your uninterruptible power supply or battery has no more energy. On my desktop this is about 15 minutes. I think my laptop will last about 3 hours. But we can always upgrade to the 'Wind-Up' Laptop[^] and generate more energy indefinitely.
Best Wishes,
-David Delaune
|
|
|
|
|
I made an application to run for Vista and provided a manifest file for the same ,with elevated permissions but while trying to run it I get an error "A referral was returned from the server."?
Can you let me know the issue ?
Kushagra
|
|
|
|
|
Hi Kushagra,
Could you paste the contents of your manifest file into the forum?
Best Wishes,
-David Delaune
|
|
|
|
|
<!-- Identify the application security requirements./>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"/>
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"
uiAccess="false"/>
requestedPrivileges/>
</security>
</trustInfo>
|
|
|
|
|
Hi,
Your requestedPrivileges tag is not closed properly. Is this a forum-only typo?
Best Wishes,
-David Delaune
|
|
|
|
|
yes Its was a typo here only and not in the original manifest file
|
|
|
|
|
Hi,
Other than that I don't see anything wrong. Could you check the machine and see if ValidateAdminCodeSignatures[^] is defined as 0x1? Is this a workstation subject to domain policy?
Best Wishes,
-David Delaune
|
|
|
|
|
No the workstation is not subject to domain policy ,.. the only this is that UAC is enabled on the machine ..
|
|
|
|
|
Randor wrote:
see if ValidateAdminCodeSignatures[^] is defined as 0x1?
Hi randor,
After cahnging this value to 0 I was able to run the application , but before that I was presented the dialog that UAC does asking user to allow the executable to run with Admin permission . can this dialog be emitted permanently ???
Kushagra
|
|
|
|
|
Kushagra Tiwari wrote: can this dialog be emitted permanently ???
Well I have no idea what you just asked me. But I think your asking if the registry key can be changed permanently. Yes you can just keep ValidateAdminCodeSignatures[^] defined as zero. This simply tells the operating system that executables do not need to be signed to be elevated.
You have another option. You can change the value back to 0x1 and sign your application.
Introduction to Code Signing[^]
Best Wishes,
-David Delaune
|
|
|
|
|
Sorry for the typo again ..Actually what I had asked you was . Is there a way that for my executable with elevated permissions that windows UAC never asks user about allowing or disallowing my process and it simply allows the exe to be executed..
Kushagra
|
|
|
|
|
No that would break the new UAC security model. Your application will be subject to UAC elevation prompts. The user can modify the behavior of the UAC and disable these prompts if desired.
Best Wishes,
-David Delaune
|
|
|
|
|
And if my sign and timestamp my executable with a certificate and install the certificate on the VISTA or Windows 2008 client in Trusted publishers , then would this UAC prompt me or will it directly allow me to execute on being invoked ?
Kushagra
|
|
|
|