Last visit was: It is currently Thu Mar 28, 2024 10:32 am


All times are UTC-05:00




Post new topic Reply to topic  [20 posts ] 
Author Message
 Post subject:Re: Another question about CrissCross
PostPosted:Sat Nov 08, 2008 5:39 pm 
User avatar
 

Joined:Sun Feb 12, 2006 8:56 pm
Posts:1019
Website:http://eddieringle.com
Location:Detroit, MI
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.

_________________
-- Eddie Ringle

Check out Elysian Shadows and consider backing us on Kickstarter!

====================================

Image


Top
Offline  
 Post subject:Re: Another question about CrissCross
PostPosted:Sat Nov 08, 2008 7:01 pm 
Literally Nine
User avatar
 

Joined:Sat Apr 02, 2005 3:31 pm
Posts:1171
Location:The vicinity of an area adjacent to a location.
char* blah = new char[50];

or

char blah[50];


one has more cleanup work than the other.

_________________
- Tycho

Image


Top
Offline  
 Post subject:Re: Another question about CrissCross
PostPosted:Sat Nov 08, 2008 8:52 pm 
Literally Nine
User avatar
 

Joined:Tue Mar 01, 2005 9:00 am
Posts:1263
50 might also not be enough. It depends on how long you think the lines can end up.


Top
Offline  
 Post subject:Re: Another question about CrissCross
PostPosted:Sat Nov 08, 2008 9:32 pm 
User avatar
 

Joined:Sun Feb 12, 2006 8:56 pm
Posts:1019
Website:http://eddieringle.com
Location:Detroit, MI
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.

_________________
-- Eddie Ringle

Check out Elysian Shadows and consider backing us on Kickstarter!

====================================

Image


Top
Offline  
 Post subject:Yet Another CrissCross Question
PostPosted:Sat Nov 08, 2008 11:15 pm 
User avatar
 

Joined:Sun Feb 12, 2006 8:56 pm
Posts:1019
Website:http://eddieringle.com
Location:Detroit, MI
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.

_________________
-- Eddie Ringle

Check out Elysian Shadows and consider backing us on Kickstarter!

====================================

Image


Top
Offline  
Display posts from previous: Sort by 
Post new topic Reply to topic

All times are UTC-05:00


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created by Miah with assistance from hyprnova