Advertisement

someone please tell me what this means?

Started by February 20, 2001 03:50 PM
15 comments, last by kalldrex 23 years, 7 months ago
WEll acraig that didn''t work. I entered:

char *username_buf= new char[25];
char *password_buf= new char[25];

and when i run the app it hangs at the beginning. Any ideas on what i did wrong?

p.s. i just changed char *username_buf=NULL to that same with the password one!
ALL YOUR BASE ARE BELONG TO US!!!!
quote: Original post by kalldrex
and when i run the app it hangs at the beginning. Any ideas on what i did wrong?



Are you sure that it''s hanging or is it just waiting to receivce data? Are you sending stuff to this sockect?

Quote from the webpage:

"If no incoming data is available at the socket, the recv() call waits for data to arrive unless the socket is non-blocking."



-------
Andrew
Advertisement
No i''m not trying to send data but look at my code and you will see it should say "testing" before it starts recieving data!
ALL YOUR BASE ARE BELONG TO US!!!!
Yeap. When I compile and run your code it works fine on my machine. Your best bet is to break out the debugger and try and see where it is stopping.

-------
Andrew
IT works for you with the char *username=new char[25];?
I don''t like this!
ALL YOUR BASE ARE BELONG TO US!!!!
you should do either

// pointer a string, similar to i.e. PChar or LPSTR
char * namebuf = new * char;

or

// array of 25 chars
char namebuf[25];

but the one you used is not such a good idea since, I think, it could cause improper stack handling (that''d be the reason why it locks up right at the beginning)
well if I''m totally wrong here plz tell me

HTH
pi~
Jan PieczkowskiBrainwave Studios
Advertisement
Um i've done some testing and the program hangs once it sees the buffer initialization with the "= new char;" on it! that's causing it to hang but without it it keeps giving me that WSAEFAULT (error code 10014)

Edited by - kalldrex on February 20, 2001 9:40:38 PM
ALL YOUR BASE ARE BELONG TO US!!!!

This topic is closed to new replies.

Advertisement