User Profile

Collapse

Profile Sidebar

Collapse
TheGTA
TheGTA
Last Activity: Dec 6 '09, 10:44 PM
Joined: Jan 22 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • TheGTA
    replied to Struct members inside another struct
    in C
    So you want to have the "p_name" from a _PLAYER struct?
    Here are ways to get this:
    - Use pointer, a char* pointer which points on the name.
    - You have "p_name" inside PLAYER, a example to set it is to do this:
    Code:
    TableFormat[0].p.p_name = "myplayer";
    Uhm, here is a simple loop-through:
    Code:
    unsigned int n;
    unsigned int arraySize = 1;
    char key[20]
    ...
    See more | Go to post

    Leave a comment:


  • TheGTA
    replied to Problem in RTL messagebox
    in C
    I never used MessageBox() WinAPI call, but I try to help.

    By some fast googling I found out the following (msdn microsoft):
    Code:
    int MessageBox(      
        HWND hWnd,
        LPCTSTR lpText,
        LPCTSTR lpCaption,
        UINT uType
    );
    
     int msgboxID = MessageBox(
            NULL,
            (LPCWSTR)L"Resource not available\nDo you want to try again?",
    ...
    See more | Go to post

    Leave a comment:


  • TheGTA
    replied to Struct members inside another struct
    in C
    "PLAYER" already is defined as struct type.
    Using typedef you have set that "PLAYER" is a own typecast.

    "struct PLAYER p" is a invalid statement, use "PLAYER p" instead.
    If you need the "struct" just use "struct _PLAYER p".

    Code:
    I would like to have something like this, which I have seen...
    
    static PlayerTable TableFormat[] = {
    ...
    See more | Go to post

    Leave a comment:


  • TheGTA
    replied to Unknown socket crash (10054) - C code
    in C
    Hmm.

    Alright, as I dont have your code I can only guess and give you some tipps:
    - In Windows, setsockopt() requires a "char" cast as opt value, did you make sure you dont give a int or short?
    - If yes, did you make sure the opt value is set to TRUE (1)?

    SO_KEEPALIVE was tested using non-blocking sockets.
    It might work else in blocked ones, idk.

    "setsockopt ()" changes...
    See more | Go to post

    Leave a comment:


  • TheGTA
    replied to Unknown socket crash (10054) - C code
    in C
    dang...

    Alright, I have fixed this... So this topic may be closed or whatever :P

    Anyone knows SO_KEEPALIVE?
    What a cool socket setting, makes your socket "stay alive".
    I really didnt find this in the C socket tutorials out there, why?
    (I mean, in no code example...)

    My logical reason for the need of KEEPALIVE is the following:
    If a socket "stays" too long...
    See more | Go to post

    Leave a comment:


  • TheGTA
    started a topic Unknown socket crash (10054) - C code
    in C

    Unknown socket crash (10054) - C code

    Hi there!

    I am working on a project for like 1 year now.
    Most of it works well.
    But somehow my socketenvironme nt craps out sometimes...

    For a totally unknown reason a socket crashes with 10054, connection refused.
    That socket usually processes easy packets with size being under 50, its a characterserver -> loginserver connection.
    Well, I found out it crashes after some time when the send()...
    See more | Go to post
No activity results to display
Show More
Working...