Computing.Net > Forums > Unix > SOS!!! Unix socket programming

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

SOS!!! Unix socket programming

Reply to Message Icon

Name: Sanjay Murthy
Date: January 29, 2000 at 15:17:01 Pacific
Comment:

I am just getting started. I have written a (simple)web server in C language. It opens a predetermined specific file (ex page1.html) and sends it out on the connection(On a predetermined port).The command line in the browser is (http://hostname:port_number)
Now, I need to get the file name from the browser(Netscape/IE5). the browser command line will be (http://hostname:port_number/filename).

I must be able to obtain the filename and put it into a char variable
How do I get the file name from the command line.

I am making the accept(....) and read(...) system calls in FreeBSD UNIX.

I am using "Internetworking with TCP/IP" by Comer vol III.
Everything else works fine.

I will be extremely thankful.

Regards



Sponsored Link
Ads by Google

Response Number 1
Name: Joe
Date: February 4, 2000 at 23:10:20 Pacific
Reply:

It is not quite as simple as accepting the connection and just doing a read. You need to implement the HTTP protocol - the web browser and your program will have a "conversation" using that protocol. I suggest you get a book on what the protocol is and how to code for it (for instance Stevens book "TCP/IP Illustrated Volume 3"), or surf the web for that information.


0

Response Number 2
Name: rakesh ughreja
Date: June 10, 2000 at 02:01:41 Pacific
Reply:

i want to make one security software for that i need to trap the opening of my default browser.
so how can i trape that i am writing my application in vc++.


0

Response Number 3
Name: Vinayak v bhairemane
Date: October 5, 2000 at 06:06:06 Pacific
Reply:

I wanted some sample programs for dialing modem in SCO unix


0

Response Number 4
Name: Ali Turki
Date: April 2, 2001 at 12:56:18 Pacific
Reply:

I m a beginner programming with sockets and
threads under solaris 2.6.
When i run a socket server sometimes
i have this message : Alarm clock ,and the
execution of server interrupts, so if you have solution contact me or send me solution
for this problem please.
Thank you


0
Reply to Message Icon

Related Posts

See More


AIX SOS Windows 98 and Red Hat Li...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: SOS!!! Unix socket programming

How do i dual boot w98 and unix sco program? www.computing.net/answers/unix/how-do-i-dual-boot-w98-and-unix-sco-program/1276.html

Unix shell Programming www.computing.net/answers/unix/unix-shell-programming/3210.html

UNIX sockets www.computing.net/answers/unix/unix-sockets/4215.html