LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-20-2004, 11:35 AM   #1
nakkaya
LQ Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
webserver & client application


i am working on a simple web server everything works fine execpt one things

the thing is when sending an file from the server to the client(this case the browser) if i press the stop button on the browser my server crashes.. this is the part of the code that causes the crash

bool Server::SendHtmlToSocket()
{
std::ifstream InputFile;
if(ReturnCode==404)
{
InputFile.open("html/error.html");
}
else
{
InputFile.open(request.c_str());
}

std::string DataSend;
char ch;
while(!InputFile.eof())
{

InputFile.get(ch);
DataSend=ch;
if ( ! Socket::send ( DataSend ) )
{
throw SocketException ( "Could not send html file to socket." );
}
}
InputFile.close();
}

socket::send just calles the send system call with correct parameters.....
can anyone point me what am i doing wrong thx....
 
Old 02-20-2004, 11:40 AM   #2
PSIplus
Member
 
Registered: Feb 2004
Location: Vienna/Austria
Distribution: Debian Unstable
Posts: 36

Rep: Reputation: 15
I'm not sure, but how do you handle the signals from the communication?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LQ.org Client Application? vharishankar LQ Suggestions & Feedback 2 04-08-2005 09:49 AM
iptables & webserver problem doblocruiser Linux - Security 12 01-28-2005 12:23 PM
Linksys & Firewall for Webserver Appliance bluefish1 Linux - Networking 8 04-07-2004 09:53 AM
C++ client application for uploading a file ciocoiuf Programming 1 06-02-2003 06:12 PM
server and client configuration oof any application on IPv6 e-ahmed Linux - Networking 0 05-17-2003 04:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration