Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. digitalpacman

    Reading the First Line of a File into CString

    Er whoops i meant you're gonna have to change the cin part to the infile stream ;xxx
  2. digitalpacman

    Reading the First Line of a File into CString

    the function getline(void,char*) getline(cin,cstringthing);
  3. digitalpacman

    Threading for multi-client server

    Ok I found the problem I think. My method of accepting users was fine, but my use of the mutex wasn't. Here it is;p declaration HANDLE g_hCreditMutex; while( 1 ) { ServerSocketObject.Listen(); WaitForSingleObject( g_hCreditMutex, INFINITE ); clients += 1; ServerSocketObject.Accept(...
  4. digitalpacman

    Threading for multi-client server

    --; Well then how do you do it?
  5. digitalpacman

    Threading for multi-client server

    im going to cry:( why doesnt my solution worrrrrrrk? void thrClientsThread( SocketObject *sm ) { // Loop until we are told to quit while( 1 ) { ServerSocketObject.Listen(); WaitForSingleObject( g_hCreditMutex, INFINITE ); clients += 1; ServerSocketObject.Accept( sm[ clients ] )...
  6. digitalpacman

    Threading for multi-client server

    Um I know its a simple thing seeing how every single game and program on the internet has to do it so someone would have by now figured out a simple and effecient way to do it. Just because its simple doesn't mean I am obliged to instantly know how to do it. In theory my way would work, but...
  7. digitalpacman

    Threading for multi-client server

    Over complicating? But I know it's a simple thing -.- Why can't you guys just show me? lol. It can't be THAT long of code can it?
  8. digitalpacman

    Threading for multi-client server

    I was just following this example in this book for learning how to game programming. I don't have any background in online programming. But I have a background in C++ programmming and computer science. I've taking 2 computer programming C++ and 2 years of AP Computer Science. I also program in a...
  9. digitalpacman

    Threading for multi-client server

    okay.. does anyone have a thread they can copy paste for me that will accept connections? ;/
  10. digitalpacman

    Threading for multi-client server

    Also here is some more information. SocketObject is just a prewritten class I'm using to learn this stuff with It is just the predefined windows SOCKET class with some variability. Here is the code for the functions I use: ----- int SocketObject::Listen( void ) { return listen( skSocket, 32...
  11. digitalpacman

    Threading for multi-client server

    Well.. since you obviously see what I'm trying to do.. you got a way for me to do it? ;X Cause this way doesn't seem to work to well. The data isn't being sent to the server. I think... o.o if( ClientSObject.Connect( szServerIP, iServerListenPort ) ) { while (true) { while ( !_kbhit() )...
  12. digitalpacman

    Threading for multi-client server

    Well I took your advice and it seems still no one=p I got a new question tho. Does this code even if its in a thread make the program wait for connections and NOT do anything else even when in a thread? void thrClientsThread( SocketObject *sm ) { // Loop until we are told to quit while( 1 )...
  13. digitalpacman

    Threading for multi-client server

    Um debugger just goes "eee find the .cpp file!" so there's no help there. Plus this is a server/client program so like yeah I dun think debugger can work on something like that. Section of code I guess that is "relevant": void thrClientsThread( SocketObject *sm ) { //...
  14. digitalpacman

    Threading for multi-client server

    erg, can no one help me?
  15. digitalpacman

    Clearing the output screen

    There is a built in "pause" function. It's called sleep. Sleep(miliseconds) so just do Sleep(50); system("cls");
  16. digitalpacman

    Help with a C++ Game!

    The syntax for a randomly generated number is: int high, low, ranNum; high = 10; low = 0; ranNum = rand() % (high-low+1) + low; ~~rar.
  17. digitalpacman

    Threading for multi-client server

    I'm currently learning how to create servers and clients for gaming purposes. I wrote a simple program which acts as either server or client. It uses multithreading for the login part of the server so that it can listen while running the program, basic heh. The error is that sometimes I get a...

Part and Inventory Search

Back
Top