| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Comments:
<0> kthx^, you might be better off including errno.h , then the int errno will have an error number <0> most libc functions set it when they get an error <0> can be helpfull <1> at least on posix. not on win32. <0> he isn't using win32 anymore. that's why he's having problems <1> ahh. <2> lol <2> it gave me a 0 on return <0> lol ?? <2> thats means success <0> that means theres no error <2> thats what i dont GET <3> GET / HTTP/1.0? <0> then it's closing the file <2> its not a file <0> I think he might be trying to port some kind of evil irc bot
<3> is that what he's doing? <2> lol <2> ircd <0> on unix/linux everything is a file <2> bots dont use close that much <3> ircd already runs on unix. <2> this is from scratch <2> 52kb <3> from scratch on win32? <2> yeah <3> how are you testing it? <2> shell <3> what client are you using, i mean? <2> mirc? <0> why would you want to port the windows version when there are versions already to run? <2> coz this is from srcatch <2> its is MINE <2> ;D <0> oh <2> learning experience <0> learning to handle frustration <2> yeah haha <2> HAHAH <2> YES WOOT <2> omfg <2> =) <2> shutdown(iClient.iSocket,SHUT_WR); <2> ^^ the solution <2> </3 <2> and to think all the professionals here didnt tell me ;] <0> still can't see why you'd need to use shutdown <1> lots of things are crappy. <0> I never do and my server stuff works <1> shut_wr usually provokes connected clients to close, so you can just wait a little for the read==0 then close as well. <4> calc shark2 <5> <shark2> I can write to stdin, read stdout, repeat <6> I did tell you about shutdown, kthx^ <2> yeah <2> i used a diff how first time tho <2> In function `ParseClient(Client*)':: undefined reference to `ParseData(char**, Client*)' <2> what would be causing this errror? <3> what, besides the obvious things? <3> or including the obvious things? <2> i have included everything <2> decalred it properly ;/ <2> lawl i got it <7> ok, i get -inf as a return value from printf(); how can i do an if() comparison to the float number if its either inf or -inf ? <4> Boro: isinf() <7> how can i know if its positive or negative ? <4> man ininf <4> oops <4> man isinf <7> ah, i couldnt find it on cppreference, let me try man <7> ok, thank you <2> if (iPoll.revents == POLLHUP) <--- that should detect when a client closes a socket? <2> if i use recv i recv a disconnection but if i use poll + recv i dont recv a disconnection ;/ <2> =[ <4> kkkkthx^: no, disconnection normally comes as POLLIN <4> you recv it, and get EOF or -1 <1> read/recv normally returns 0 on normal disconnect.
<4> yeah, s/EOF/0 for eof/ <8> i dont know if here is the right place to ask about windowZe. but okay.. i need to get the mac-address from a network interface. i can't use netbios, and querying ndis with DeviceIoControl makes it incompatible with non nt-based systems.. as well using SendARP, cause iphlpapi doens't exists in such systems. <9> If you don't get an answer, try #winprog <8> ah, thanks. <10> howdy hund <9> Hello Joe. <9> Boyoboyoboyoboy. <9> Ritchie made it you know, albeit not alone. <11> hey, is there any way, under freebsd(phk malloc i guess) to check if a pointer p***ed to free() actually is inatialized (ie in the case of say malloc(0), the c spec doesnt guarantie a NULL pointer to be returned) <9> You'll have to use a memory profiler. <11> so there is no way for me in C to simply check the pointer (void *) for wether its initialized? <9> I'm not so sure if I know what you mean. <1> not safely. <11> consider this: you have a call to malloc() with a size depending on the length of something, and at times the call might be malloc(0); (although never a negative number) <1> if you hate portibilty you could check if the control blocks are where they should be. <11> when malloc(0) occurs malloc() doesnt return NULL (atleast on freebsd 6, haventested others) <9> He did specify freebsd. <11> (and this is according to c spec) <1> p = malloc(something); if (something && !p) { /* oops, failed! */ abort(); } <11> i already have such a check but theres still a unitializationg problem there <9> hylandrr: ANSI C says that malloc(0) either gives a NULL pointer or a unique pointer. <1> either of which may be safely free'd. <1> i.e., free(malloc(foo)) is safe for any value of foo. <1> (though you might run out of swap!) <0> I always thought freeint a NULL pointer made an exception <9> "If ptr is a null pointer, no action shall occur." <11> hund: this is from the freebsd mailinglist, on a question someone posted <11> // The C standard does not require malloc(0) to return NULL; <11> > // but whatever it returns MUST NOT be dereferenced. <1> right. so don't. <9> hylandrr: Dereferenced is a whole other issue. <9> hylandrr: Dereferencing is when you use * or []. <1> p = malloc(something); if (something) { if (!p) { /* failed! */ abort(); } ... } <11> yes but read what it saysl it doesnt guarantie that it returns a null pointer <11> a // The C standard does not require malloc(0) to return NULL; <11> err <11> mispaste <11> hund i know that <1> notice that i test if there was an allocation requested. <9> Yes, but it's guaranteed to be *unique*. <11> hund: and how do i check that?:P <9> How do you check what? <9> You might want to zoom out and tell us the real problem at hand. <11> malloc(0); returns neither a NULL pointer and neither something i can p*** to free() <11> thats the problem. <8> well. you can free a malloc(0) return value (the pointer to ZERO size buffer). <11> now how do i check for this case?:) <11> phoenixx on freebsd that leads to a verbose error <9> Why do you need to check? Just do it. <8> did you tested it? <9> No, malloc(0) always gives something you can p*** to free(). <11> phoenixx yes <8> do it in a while loop <8> in a simple program and test again. <11> hund i told you my problem like 3 times now. <11> phoenixx ive tested this for 4 days now:P <9> And yet you don't listen. <11> hund you dont understand my problem it seems, perhaps im not making myself clear. <11> pastebin <11> hold. <8> good choice :) <9> hylandrr: http://rafb.net/paste/results/expug694.html <9> hylandrr: That's perfectly conforming. <8> put it on a while loop for m***ive test ;p <11> hund: od in free(): warning: chunk is already free <11> heh <1> that's just your memory debugging being stupid. if you care you can compare foo against 0. <11> twkm that was hunds testprogram <11> :P <1> i understand. <11> http://pastebin.ca/77827 heres the memory functions i use <1> you commented on it. <1> i commented on the comment.
Return to
#c or Go to some related
logs:
9ale7 shhab
#firebird #windows GTA SANDANDRS cygwin crap #gamedev mr zulo gay #beginner flash buttons.fla #politics
|
|