GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 19-May-2006, 10:00
AJSHOPE AJSHOPE is offline
New Member
 
Join Date: May 2006
Posts: 1
AJSHOPE is on a distinguished road

Reading socket input streams.


Hello, I'm currently trying to write a concurrent webserver in Unix. I need to process the Http requests seperately. I'm not using connect(), I'm just using accept and then I need to read the socket input stream and parse the Http request. After this I am trying to construct the response message and then send it to the client.

I've tried a few different ways to read the socket input stream, but I'm not getting anything that looks like an Http request. For instance I need to process...

GET /somedir/page.html HTTP/1.0
(extra carriage return, line feed)

I only need to worry about the GET function for the Http requests. I guess my question is what is the surefire way to read and parse this request from the socket? Any help would be greatly appreciated. Thanks.
  #2  
Old 21-May-2006, 09:55
Tellamalla Tellamalla is offline
New Member
 
Join Date: May 2006
Posts: 1
Tellamalla is on a distinguished road

Re: Reading socket input streams.


Hi,

now i am fired up with the c++ .
could u give me the answer for this one .
we have typecasting operator in c. why we need some compelx typecasting operator in c++ like static_cast,dynamic_cast and reinterpret_cast.
can u explaint some thing for it.


thanks&regards
robert.T
  #3  
Old 21-May-2006, 16:42
ubergeek ubergeek is offline
Regular Member
 
Join Date: Jan 2005
Posts: 775
ubergeek is a jewel in the roughubergeek is a jewel in the roughubergeek is a jewel in the rough

Re: Reading socket input streams.


Please start new threads for new topics.

In C, typecasting is very dangerous because you can make the compiler pretend any type is any other type without a conversion function or anything. In C++, there are the four kinds of cast operators that do subtly different things. There are many resources on the Internet about these. Have you tried searching Google! Here's a good one (but there are many others): http://gethelp.devx.com/techtips/cpp...0min0701-2.asp


@AJSHOPE:
Quote:
I've tried a few different ways
What ways? Can you show us the code? What went wrong? I guess I'm not sure exactly what your question is--are you trying to read the info from the socket and not getting what you expected (what are you getting, then)? Are you trying to parse the input?
 
 

Recent GIDBlogDeveloping GUIs with wxPython (Part 3) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[PROGRAM] Winsock Programming Max Payne MS Visual C++ / MFC Forum 1 08-Mar-2007 23:38
Reading and Writing to a text file raptorhawk C++ Forum 16 14-Apr-2005 13:09
GradeBook Program x3ro C++ Forum 19 03-Apr-2005 19:28
[C] Discarding input Alhazred C Programming Language 8 04-Aug-2004 11:45
IP tables rogermark100 C Programming Language 6 18-Apr-2004 07:22

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 21:19.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.