Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

Nuxser

@Nuxser
About
Posts
9
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • XML Signature
    N Nuxser

    If you are developing on .NET platfrom: http://msdn2.microsoft.com/en-us/library/system.security.cryptography.xml.signedxml(vs.71).aspx -- Soyuz

    C / C++ / MFC c++ xml question

  • Winsock Interrupt
    N Nuxser

    Default behavior of send(...) & recv(...) is blocking on the call till requested operation is finished. Not aware of how this wait is internally implemented. As an application programmer, I assume that you want to model your application so that it doesn't block on such calls and utilize the CPU cpu cycles for other tasks. If that is correct, you need to explore which I/O strategy we want to use: http://tangentsoft.net/wskfaq/articles/io-strategies.html Translating the "interrupt" to be the case where instead of blocking you want the program to be notified when data is there to read, WSAAsyncSelect() can be an easy path to go as your app/window is notified through message loop. -- Soyuz

    C / C++ / MFC sysadmin workspace

  • Critical Sections
    N Nuxser

    Isn't it a deadlock type situation? I say 'deadlock type' since there will be eventually an exception raised by second EnterCriticalSection(...) as it waits and then times out because the first EnterCriticalSection(...) didn't leave yet. -- Soyuz

    C / C++ / MFC help

  • Function-style cast
    N Nuxser

    http://www.warpspeed.com.au/cgi-bin/inf2html.cmd?..\html\book\IBMVACPP\CPPLNG.INF+184 Though no example but made clear points of how function-style cast behaves in C++.

    C / C++ / MFC question

  • Socket
    N Nuxser

    Not very clear about your problem from your post. Generally, for a server process you will, 1. Initialize Winsock 2. Create a socket and bind it to network interface and port. NOTE: This is the listening socket 3. Then, you can say, prepare the socket to listen for connection request in that socket 4. Then you wait on that socket for incoming connection by accept(..) call. When this call returns, it will return a new socket where the client is connected. Note that the original listen socket is not used by the connection. You take the new socket returned by accept(..) and do you communication and finally close it. You must not close the socket on which you are listening. So in that regards, I am not sure in your post, which socket you are closing. (Even if you are using Unix/Linux the concept remains the same as they are POSIX sockets) Look at the example given in the link: http://msdn2.microsoft.com/en-us/library/ms737526.aspx Within the example, once accept has return with a valid connected socket (a.k.a the 'else' portion of the check) you can initiate a thread where you will use the socket to do your stuff with the client and close the socket. You only close the socket you are listening on, when you terminate the server app or you do not wish to listen for connection on that socket any more. -- Soyuz -- modified at 1:45 Thursday 5th July, 2007 Wanted to add that, once accept(...) returns, and you deal with you client (either by initiating a separate thread or in the same thread) you need to go back to wait on accept(...) again to server other incoming request. With the close & shutdown call, I remember an issue about the TCP/IP stack taking some time to actually making the socket available for further reuse and the workaround was (as far as I remember) to set socket option to socket reuse.

    C / C++ / MFC sysadmin

  • runtime type casting
    N Nuxser

    Just in case I wan't clear about it - I agree with Matthew Faithfull. And interestingly enough, quick Googling shows that there seems to be few implementation of Reflection in C++. http://www.extreme.indiana.edu/reflcpp/ Hey, Its C++, It can do everything ... ;)

    C / C++ / MFC c++

  • runtime type casting
    N Nuxser

    Must admit that I am not sure if I understood your problem. But according to I interpreted, when you talk about converting types, you imply the concept of "casting" (Casting one data type to be another). With respect to your given pseudocode, I guess you want the type pointed by "out" to be treated as type "in" so that the assignment can work nicely. Thus you want to cast the type pointed by "out" to be as type pointed by "in". If that understanding is true ... You need to delve in to understanding how "type casting" works in C++. A nice tutorial - http://www.cplusplus.com/doc/tutorial/typecasting.html I like it as they quickly goes into how type casting with classes/structs and pointer to those needs to be carefull than for basic types. Also for completeness, even in the case of template, it will eventually boils down to type casting as soon as the type is provided for the templates. So if you have defined two template types being them as type independent, during the runtime they are associated with provided types, hence the game boils down to type conversion between those two types. So understanding the "type casting" will enlighten you about how to do it and if done will it be meaning full. And for the conclusion, you will see that even though it is not a runtime error some casting will not be meaningfull or result in an wanted manner. There is no such freedom as converting ANY type to ANY type. Its not meaningfully possible (such as converting a student info class to a integer number). Hope it can help. Regards

    C / C++ / MFC c++

  • How can I ensure that a drive is spinning and ready to write data?
    N Nuxser

    This is more about Power Management than Disk Management. So (assuming that the disk doesn't have inbuilt smartness to act on power management and completely relies on OS for power mgt), 1. You could set the power management policy in windows (Control Panel!!!) so that it doesn't put the HD in sleep. This doesn't require coding but than needs human intervention in every PC where you run your app. 2. Play with power management API ( SetSystemPowerState(..) or alike) so that your app can notify the OS to not step in and do power management. Don't forget to revert system state on application exit (if required). But must say, above are from my concept rather than any real work relating to such situation. But I know for sure that there exists some API where a app can tell OS to not kick in power mgnt policy.

    C / C++ / MFC question c++ help

  • Fire Fox Toobar in C++/C#
    N Nuxser

    Provided the fact that Firefox uses its own framework and hence extension mechanism are really specific and customized to that framework, I am not sure how using VS IDE will help more than the specialized tools provided by Firefox to do the job. Following link should help. http://www.devsource.com/article2/0,1759,1995990,00.asp But also take a note of the authors blog http://www.amazon.com/gp/blog/post/PLNK2OLL1EDO876SB Regards

    C / C++ / MFC csharp c++
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups