Code to Join: struct ip_mreq mreq; // mreq is the ip_mreqstructure { struct in_addr imr_multiaddr; //The multicast group to join struct in_addr imr_interface; //The interface to join on } #define RECV_IP_ADDR "225.6.7.8" // An arbitrary multicast address mreq.imr_multiaddr.s_addr = inet_addr(RECV_IP_ADDR); mreq.imr_interface.s_addr = INADDR_ANY; err = setsockopt( sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char*)&mreq, sizeof(mreq));
Igor Proskuriakov
Igor Proskuriakov
Posts
-
Multicast in c++ -
Vendors and different types of librariesJust to clarify a few points. I am getting static library from vendor and the thing is: I do not really want to debug vendor's code, but I just want to separate my bugs from vendor's ones. It looks to me that Purify often reports memory leaks because we are using different CRTs. To simplify a problem: I am freeing memory allocated with release version of opertor new, using debug version of delete. But if I switch to release version of CRT, I cannot use Purify, so I cannot really tell if there are bugs :-( Igor Proskuriakov
-
Do you still buy LPs?No, I do not buy LPs, 'cause CDs are too cheap in Russia ;-) Igor Proskuriakov
-
Vendors and different types of librariesHello there, I am trying to make some vendorto provide a library which uses not only release version of mutithreaded CRT, but debug multithreaded DLL as well. My main problem so far is using it with Rational Purify: first it complains about two CRTs in use and sometimes it complains about memory leaks, but it is hard to trace them. Do you think that it is sensible? (to ask vendor for debug version) Have you also done it for your projects, what is your experience with such issues? Thanks! Igor Proskuriakov
-
Bad Coding?That code is definitely an example of bad coding. The thing is that it is equivalent to the code where SOME_CHARTTYPE6, SOME_CHARTTYPE7, SOME_CHARTTYPE8, SOME_CHARTTYPE9, SOME_CHARTTYPE10 are ommited. I.e. the code can easily look like the following: switch( dwSomeValue ) { case SOME_CHARTTYPE1: case SOME_CHARTTYPE2: case SOME_CHARTTYPE3: case SOME_CHARTTYPE4: case SOME_CHARTTYPE5: { // // Some Code... // break; } default: { // // Some Other Code... // } } Igor Proskuriakov
-
WatchesI personally prefer Swatch. IMHO Irony series looks almost perfectly with a suit (if it is necessary for an interview), at least much better than Fossil or Timex. Regards, Igor Proskuriakov
-
Ideas, Notes etc. What do you use?I also use TreePad for my own notes. I like it: it is free, does not require installation, everything is in one file. I beleive that you can synchronize it with Palm. TreePad plus is commercial version and allows use of RTF and some other features. Igor Proskuriakov
-
RealONE opinions?>Have you not tried Winamp? >LOL of course I have, Maybe you have not really well. Crossfader http://sqrsoft.audiogalaxy.com/ makes perfect fading from one song to another. WinAmp is free, it has its SDK and there are many plugins around. I do not see much resons to pay for realOne at this point. Regards, Igor Proskuriakov
-
Source code formatting toolsThe main issue with GNU indent is that it does not understand C++, only plain C. To illustrate this problem I can mention that code after running through indent can stop compiling. Something like vector > can become vector>. Artistic Style does understand C++ but lacks all the options which indent has. The macro on codeproject.com does not have any configuration, but I personally like its setup. Unfortunately there are still some bugs in it. Hope it helps. Igor Proskuriakov
-
MS STLIt was one of the reasons why many people decided to switch to better STL, especially STLPort X| Igor Proskuriakov
-
Rebuilding project (VBS)Very often when building large project I also like to modify sources. What I want to have is the macro which builds project, but then checks if any files were changed since that build and if so - builds again, otherwise stops. I hope this replacement for standard build command will help many people. Thanks. Igor Proskuriakov
-
Boundschecker thoughtsYou definitely need at least one of such instruments if you are doing serious development. If you have a lot of money, I would even recommend to buy both purify and bounschecker - they are using different techniques. You also should be aware of limitations and bugs, for sure every reported error is not a real error. If you need to choose between Purify and BoundsChecker - download trials for both and compare ! Another similar product is HeapAgent. It is cheap, limited, but might be better for release versions, it almost does not slow execution time. Igor Proskuriakov
-
How to prevent???I would be very much concerned once noticing hijacking of four airplanes during one morning. I would definitely use fighters to patrol those planes. Igor Proskuriakov
-
GDI+ in use...Hi, I do not know the answers on your questions, however I can recommend to look at Understand for C++, they made export of C++ class hierarchies to Visio, you might try to evaluate how they have done it. Igor Proskuriakov
-
C++ standards complianceC/C++ users journal had a roundup on all major compilers, very good article indeed. Search on www.cuj.com. I did not find any problem with STLPort, use this stlport for posting map problems. Another option can be to buy upgrades for Dinkumware site. Igor Proskuriakov
-
Find library which exports a functionHi, Is there an utility, which searches libraries for a particular function, which library exports? Or is there any better tool than dumpbin? Thanks, Igor Proskuriakov
-
Favortite BooksHi, I remember that a while ago, Chris had asked us to send him the list of our favorite books on different topics and he started to make a web page with those books. Unfortunately I cannot find this list any more on this site. Does it still exist? If not, I think it is great if will exist, it can even contain a link to amazon or to anybody, to give the small profit. Regards Igor Proskuriakov
-
Documenting design and codeI can recommend to look at doxygen or doc++ (I prefer the former). It gives you ability to document your classes in the source code and then just produce html documentation out of source code. Let me know if find anything better. proskig@hotmail.com Igor Proskuriakov
-
How does a good coder... code?Hi, There are some good books on this topic: Writing solid code, Code complete, etc. They are trying to cover a topic of how to write a good software. I strongly recommend to start with them (check also Extreme Programming), although I agree that there is a space for a good book, covering maybe one big project and revealing some code techniques. But there will be always a place for small articles, covering in more details, how to do this or that, e.g. how to implement trace, logging, assert, etc. Igor Proskuriakov
-
XML for application configurationHi, At the moment I am thinking about rewriting config file package which we use in our company. Can anybody recommend me to use XML for application configuration. Unfortunately I do not have big experience about XML. Can you tell which advantages can I get from using XML? Is there any C++ packages ready which can validate XML file and for example give me the value of an item under section? (I am talking in terms of standard INI files). Any ideas, suggestions? Thanks, Igor Proskuriakov