| Ferrous Moon http://www.ferrousmoon.com:80/forums/ |
|
| Another question about CrissCross http://www.ferrousmoon.com:80/forums/viewtopic.php?f=45&t=1497 |
Page 2 of 2 |
| Author: | eddieringle [Sat Nov 08, 2008 5:39 pm ] |
| Post subject: | Re: Another question about CrissCross |
Okay, then can you tell me what to use as a buffer? I thought that char *l was what I needed to do, I guess not. |
|
| Author: | Tycho [Sat Nov 08, 2008 7:01 pm ] |
| Post subject: | Re: Another question about CrissCross |
char* blah = new char[50]; or char blah[50]; one has more cleanup work than the other. |
|
| Author: | Miah [Sat Nov 08, 2008 8:52 pm ] |
| Post subject: | Re: Another question about CrissCross |
50 might also not be enough. It depends on how long you think the lines can end up. |
|
| Author: | eddieringle [Sat Nov 08, 2008 9:32 pm ] |
| Post subject: | Re: Another question about CrissCross |
Quote: 50 might also not be enough. It depends on how long you think the lines can end up.
Yeah, figured that out after I decided to document the config file a bit more. It's set at 250 right now, but I doubt one line will ever reach that length, so i might lower it to 80-something.
|
|
| Author: | eddieringle [Sat Nov 08, 2008 11:15 pm ] |
| Post subject: | Yet Another CrissCross Question |
Code: int Server::ReadSocket(TCPSocket *a)
{
TCPSocket *s = a;
char *in = new char [250];
unsigned int len = 250;
if (s->Read(in,&len) == 0) {
sconsole->WriteLine(in);
return 0;
} else {
return 1;
}
}
I'm switching to c-style strings, and I changed them in ReadSocket to prepare for writing the HTTP Request Parser. Anyways, s->Read(in,100) looks completely valid to me, but the compiler whines about invalid conversion from int to unsigned int *.EDIT: Fixed with above code, got help from a C++ community forum, if something seems amiss, tell me. |
|
| Page 2 of 2 | All times are UTC-05:00 |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|