Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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.

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++.

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

![]() |
AIX SOS
|
Windows 98 and Red Hat Li...
|

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