|
-
Mar 4th, 2008, 02:39 PM
#1
Thread Starter
Frenzied Member
[2005] TcpListener or HttpListener?
When developing a custom server, and that server needs to be installed inside a network that only allows incoming requests from outside the network using port 80/http, would this force me to use the HttpListener class to build my server on? I gather I could set my TcpListener to monitor port 80, but I do know that most firewalls/proxys are smart enough to know if the incoming request is wrapped in appropriate http code, even though it's on port 80.
I don't need the overhead of http since it's not a "web" app, but I have to consider the possibility of inbound requests over port 80/http.
Any advice would be appreciated.
-
Mar 4th, 2008, 02:44 PM
#2
Re: [2005] TcpListener or HttpListener?
Any of the two will do, but I'd go for HttpListener as its specifically made for this purpose.
-
Mar 4th, 2008, 04:22 PM
#3
Thread Starter
Frenzied Member
Re: [2005] TcpListener or HttpListener?
Great. So just to be sure, even though this app will not be accessed via a web page, but rather a custom designed client, as long as the client is submitting "http" requests it should work? Just for some brief info, the client app will be submitting custom package of data for which the server will act on once received. Sorta like a zipped file from the client but sent through as an http post.
-
Mar 4th, 2008, 04:47 PM
#4
Re: [2005] TcpListener or HttpListener?
Aha, so you're not going to send an HTTP request to the listener? In that case I'm not sure if the HttpListener will work for you. I havent used it personally but I think it relies on receiving proper HTTP requests.
-
Mar 4th, 2008, 04:57 PM
#5
Thread Starter
Frenzied Member
Re: [2005] TcpListener or HttpListener?
Well, from the client, if I use the HTTPRequest class and "post" a properly formatted http message, it should go through the firewall. However, is there a way to "post" a file with the HTTPRequest class?? I guess it would be comparable to uploading a file via http.
-
Mar 4th, 2008, 05:01 PM
#6
Re: [2005] TcpListener or HttpListener?
Yeah just read the file as binary and send the binary data in the body of the http request. Set the content-type header to the appropriate mime type if needed.
-
Mar 4th, 2008, 05:09 PM
#7
Thread Starter
Frenzied Member
Re: [2005] TcpListener or HttpListener?
Sweet! Sounds real promising. I see you have some great code on here for the TCP class, but I wonder how easily adopted it is to the HTTP class???
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|