Hi, I'm in the need of a new project type for VS2005. This includes a new language with syntax highlighting and possible intellisense etc... (This is just a test project, the compiler is already there so i just want to try if i can make developing for it easier by doing this) Now i've recently been looking into the VS SDK and especially the Managed packet framework. I know this already made things a lot easier, however i was wondering if DXCore would be an option for this task? I dont have any experiance with both of them, however i found the managed packet framework rather complex and still a bit messy. especially with the limited documentation. Does any of you know if the same goal can be reached with DXCore and is it worth it to give it a try? Thanks in advance! - Koen
Polity4h
Posts
-
Creating a new project type -
Search techniqueHi, Once upon a time ( like a month ago or so ) my code project newsletter rolled in my mailbox. Happy as i was i started reading some articles. With that i quickly skimmed a nice acticle serie about some or other search algorithm used for text search which checks if the searchword is something like any word in a random text. Now i find myself in a need to implement that algotithm, however me beeing brain dead and all i cant seem to rembember the name of the search technique nor the name of the article serie. Can someone point me in the good direction? Thanks already! - Koen
-
future of the windows platformAh i see, nice answer. I started developing in Delphi however i didnt feel anything for the syntax so after i controlled delphi reasonable, i switched to C++. Spended 3 years learning C++ and after that C++/CLI. Made some applications with C++/CLI and i already saw myself continuously moving to the .NET framework. After that i got a job developing with C# and i was amazed over the language and its power and clean code. But i still couldn't say goodbye to C++ and i'm sure i wont. In my latest application which is a server application doing loads of processing continiously, i choose C++ as my library language, C++/CLI as the bridge between the unmanaged and managed code and C# for the interface. The reason for this question is that i also have to develop a client application which is going to be an activeX plugin. However, looking at the posibilities, i saw that there was no way developing an ActiveX plugin with C# without switching back to old Win32 and COM so i learned ATL, just for fun. Strangely i loved the complexity because ATL dives very deep in the power of C++. Then i came to a small decision problem. The interface for the client have to be very complex and both MFC and .NET have it in them. .NET is the logical chose because i already know alot of it and its easy to use and extend, however because the rest is using ATL i can use MFC to keep the dependencies as low as possible. I'm still not sure which one to take. The plugin needs to be small. .NET creates small executables however i cant make sure that the user have installed the .NET framework and that is a really huge disadvantage. ( I aim for gamers as users so expect some heavy machines with new software ) So i'd like to ask 2 more question First: What do you recommend from the story above: .NET or MFC? Second: What about DirectX? ;) just a small mind bothering Thanks in advance! -Koen
-
future of the windows platformYes it does, thanks. It would be a shame to drop win32. however, what about COM?
-
future of the windows platformthats nice but i was asking for the future of the windows framework's on the windows platform.
-
future of the windows platformHi, I'm a working and learning developer developing my applications in a wide variation of frameworks for the windows platform, i create my servers with native C++ and a little support of the win32 api. At the office i'm currently developing with the .NET framework and i must say its a wonderfull framework, however i dont have extreme knowledge of a specific framework, i know .net quite a bit however when talking about the .net framework 3.0 i'm still new to that. I also have some skills with ATL, developed a few activeX projects with it. Now i'm a bit blury about something, i just got myself a book on MFC but i'm thinking, whats worth it learning MFC, i mean with .NET rising on the windows platform, what will be the future of techniques like MFC and ATL in the next couple of years and more importantly after that. I could ofcourse learn MFC and i will because i just find it darn interresting and fun to do, however i'm not sure if it will be still suported and widely used in the future. Do you think that its better to completely focus on the .NET framework? What is going to happen to frameworks like MFC and ATL? is it going to be used alot or is nearly every windows developer slowly moving to the .net framework? I hope you guys can give me a clear vision because i just dont know. Thanks already! - Koen
-
Native executable to managed DllHi, A long long time ago in a compiler far far beyond now, VS2005 without sp1 ;) ... -_-, i've developed a project using native C++ and a lame shell interface, now i thought it could be fun converting the project to a C++/CLI DLL with a managed wrapper class for the main functionality normally controlled by the old shell input and an interface developed in C#, this all works great, however as soon as i switch my executable to dll build, i get a fatal error in the interface telling me he cant load the assembly updater3 wich is my managed dll. I probably thought this would be because the lack of a AssemblyInfo file, however creating a new dll, ripping the assemblyinfo and editing it doesnt help a bit. Is there someone who can tell me wich rules apply when converting a native application to a managed dll Thanks already!
-
Deployement strategyHi, im looking for a deployement strategie. I've been looking into a few techniques, Windows installer and click once installer. Both are nice but they bot have their downsides. The best technique would be one equal to suns JAVA runtime files (Just a webpage with a download and installation bar) Requirements for the installation: The application is based on the .NET framework 2.0; The .NET framework 2 must be installed whenever the framework is missing. A solution for installing under limited rights would be wonderfull! An easy to edit configuration file of the setup project would be nice because there will be multiple instance of a single application ( This aint required or what ) I Hope i'm posting this in the right section, Thanks already! - Koen
-
One last IOCP question :)src=msdn:The Windows Sockets ConnectEx function establishes a connection to a specified socket, and optionally sends data (called connect data) once the connection is established. The ConnectEx function is only supported on connection-oriented sockets. remember, i'm forced to use connectionless protocols :) thanks anyway
-
One last IOCP question :)ok :) now i know enough. thanks for everything mark, you've helped me alot
-
One last IOCP question :)...I could however close the socket and open it again, but what are the drawbacks of this? this means that i need to close and open like 20 sockets per second in the future... hehe, anyways your saying that your server wont suffer to hard when creating AND DESTROYING lets say 2 sockets per second?
-
One last IOCP question :)alright, i might have thought a bid to far in the future were i got myself a mainframe ;) << -_- whatever, anyways, lets say 2 sockets needs to be created per second. wont this kill my system after doing this a long time ( my app needs to run constantly for, count them up a few years ) << thats the perfect vision ofcourse.
-
One last IOCP question :)CancelIo doesnt work, the thing is that it needs to be ran from the same thread where Overlapped operations were posted. I could however close the socket and open it again, but what are the drawbacks of this? this means that i need to close and open like 20 sockets per second in the future. looks really hard to me, but i cant really figure out what might happen when i do this.
-
One last IOCP question :)sure:
int Recieve(char\* buffer, size\_t buflen){ if (m\_iLastRecieved > 0){ //Were expecting a second packed m\_wsaBuf.len = static\_cast(buflen) - m\_iTotalRecieved; m\_wsaBuf.buf = buffer + m\_iTotalRecieved; m\_wsaBuf.buf\[0\] = 0; } else{ buffer\[0\] = 0; m\_wsaBuf.len = static\_cast(buflen); m\_wsaBuf.buf = buffer; } static int sockaddr\_len = sizeof(sockaddr\_in); DWORD temp(0); setStatus(RequestRecieve); //returning 0 is ok return (PostQueuedCompletionStatus(m\_hIOCP, 1, reinterpret\_cast(this), getOverlapped()) == FALSE); }
Thats where i make my request to post. You might wonder if it aint dangerous for the buffer to overflow or something but most of the checking goes outside this function and i can assure that there is no overflow since i'm only testing with 1 game which is secured in any way i know off. The requested bytes is unknown, it can variate depending on the used game from like 100 to a few packets of 1500 kb however mostly its just something like 1 packet with 600 bytes (i know because my previous version of the application worked perfectly, only it wasnt using IOCP just the lame one thread per server way ) anyways, with this topic still being open and all, there is one other ugly thing i cant find a good solution for. Is there any way to close a overlapped operation because i need to reuse the overlapped structures, and that means that if there is a timeout check function somewhere in my application just running once in a while over all the overlapped operations looking if they arent timed out because it could hapen that one of the 1000 servers wont give a response for some or other reason and else the overlapped structure would be in use all the time waiting for nothing to come.
-
One last IOCP question :)i stripped the functions in the main code so its easier to read. this is what happends. i got a list of virtual sessions, every virtual session can be used once at a time (logical) as soon as a virtual session is released, at will be reset to another host and a post the the IOCP will be made with the task set to Begin. I've checked and counted. it one virtual session, the enum will be set to Begin and a post will be made, then he calls the member function RetrieveServerInfo which sets the buffers associated with the virtual session only, set the enum to RequestSend which sends the data. this happends one time, then it goes to after send and then the request send. till now all those steps have been held 1 time per session. After that he goes to afterrecieve. this step he repeates for a few time, even if the session is released. it might be that i use the same session AND OVERLAPPED structure for the new server query.
while (pThis->m_bKeepAlive){ BOOL bIORet = GetQueuedCompletionStatus ( // Get a completed IO request pThis->m_hIOCompiltionPort, &dwIoSize, reinterpret_cast(pThis), &ptrOverlapped, INFINITE); ptrOverlappedPlus = reinterpret_cast<_OVERLAPPEDVirtualSession*>(ptrOverlapped); ptrSession = ptrOverlappedPlus->pClientContext; if (!bIORet){ __REPORT("Winsock error code: %i\n", GetLastError()); Gameye::Library::Thread::CMPThread::Sleep(0); } else{ CAbstractServerClass* ptrGameClass = (*pThis->m_ptrGameManager)[ptrSession->getNDServer()->GameID]; if (ptrGameClass == NULL){ __REPORT("Game is unknown, probably removed"); } else{ objToolset.Session = ptrSession; switch(ptrSession->getTask()){ case Begin: //Starts the procedure pThis->m_objAddGameToolset.Session = ptrSession; ptrGameClass->RequestServerInfo(ptrSession->getNDServer(), &pThis->m_objAddGameToolset); break; case RequestSend: //Request to send a packet dwIoSize = 0; iTemp = 0; ptrSession->setStatus(AfterSend); if (WSASendTo(ptrSession->getSocket(), ptrSession->getWSABuffer(), 1, &dwIoSize, 0,reinterpret_cast(ptrSession->getAddress()), sizeof(sockaddr_in), ptrSession->getOverlapped(), NULL) == -1) { int iErrorCode = WSAGetLastError(); if (iErrorCode == ERROR_IO_PENDING){ break;
-
One last IOCP question :)Alright, school is up back to the IOCP server :) Everything works near to fine now, thanks to the good help i got from this site. Anyways, there is one small problem/bug/design flaw left. I currently found a way around it but i dont like having ugly code with a way uglier solution. Ok again im still using the IOCP with UDP. Anyways, The problem is that i get trash in my completion ports. for example, i send something which goes fine by the way. After that i do a WSARecvFrom. Then i retrieve a IOCP notification pointing to the right extended overlapped. Now, the data inside is somethimes the right data i expected to recieve with the right size like 600 bytes, but somethimes it returns a size of 1 and no data unless i give it some time. So what do i do, i just continue and recieve a next notificication when recieving 1. this next notification contains the right data + size, so my first question, why did i get notified about my recv request before he comepletely recieved the data. a second problem, whenever i had the right data, it notifies me for like 2 extra times about it before nocking it off. Anyone knows a NICE way to prevent this because its really ugly. Thanks already!
-
IOCP+weird latency problemHi, again a question about me with my IOCP skills :) ok, the situation is the following, everything works perfectly except for 1 thing, a really weird thing if you ask me. I'm currently testing so i use 1 WorkerThread with 1 udp virtual connection at the time. When i do a WSARecvFrom, i should recieve a buffer with a size of lets say 600 bytes. This hapends idd but later, here is my thing:
GetQueuedCompletionStatus(...) DWORD ioSize = 0; case RequestSend: //WSASendTo and set to AfterSend break; case AfterSend: //Sended 8 bytes, now recieve with WSARecvFrom and set to AfterRecieve ioSize = static_cast(lpOverlapped->InternalHigh); break; case AfterRecieve: ioSize = static_cast(lpOverlapped->InternalHigh); //do rest
This is the things i do, now it happends that in AfterRecieve, ioSize is the same as the size when i sended. better said, the data aint recieved yet, however i do get a notification that the data is recieved. When i put a breakpoint at that point, i see that the data is deliverd, to pull a conclusion, I get a notification when the data is recieved well it isnt untill i put a breakpoint at that place, really weird weird story so:dwIoSize = static_cast(ptrOverlapped->InternalHigh); ptrSession->incRecvBytes(dwIoSize); if ((iTemp = ptrGameClass->UnpackServerInfo(ptrSession->getNDServer(), &objToolset)) == 0){//Session is finished! pThis->FinishGame(ptrSession->getNDServer()); __REPORT("SUCCEEDED"); } else if (iTemp < 0){ __REPORT("%s->UnpackServerInfo() failed", ptrGameClass->Gamename()); }
To make it even more clear, whenever i put a breakpoint at: ptrSession->incRecvBytes(dwIoSize);, dwIoSize is 8 as the send buffer, but ptrOverlapped->InternalHigh is like 600 bytes. When i do reports, it just reports that ptrOverlapped->InternalHigh is 8 -
Windows Mobile 5 / C++ simple question / beggingreinstall?
-
IOCP and ERROR_IO_PENDINGok, thnx :)
-
IOCP and ERROR_IO_PENDINGok, i see that makes it all clear. In a related question, when i have multiple threads and when i do a WSASendTo or whatever, it returns -1 so i use WSAGetLastError(). to retrieve the error. Does WSAGetLastError() returns the last error associated with that specific thread, or could it happen that 2 threads at the same time store an error and that i might retrieve an error from another thread with WSAGetLastError()? ( doest seems likely but who knows)