Sending data to a TCP server via a browser


#1

Hi

I am trying to send data to a TCP server created in OpenAT, using wip_TCPServerCreate, via a browser. Basically I want to know if it is possible to fire the WIP_CEV_READ event in the wip_TCPServerCreate event handler (the event handler for client TCP sockets) using HTML code.

Does anyone know how to do this?

Ralph


#2

You cant fire the event, the event just pop when a packet arrives and you must do a wip_read to know what to do.


#3

Using a browser really doesn’t sound like a sensible approach for this point in your development?!

A browser will expect your application to speak proper HTTP, and to serve-up proper web pages over it - but it doesn’t sound like you’re even got a basic TCP socket going yet?!
This sounds very much like you are trying to run before even thinking about crawling!

I think you would be far better off with some simple socket-level tester - like this: simplecomtools.com/ProductCa … category=5


#4

Thank you for your replies.

I have a working TCP server socket. I coded it in OpenAT with some help from the TCP server sample. I have a dynamic public IP address given to me by my service provider and I use DynDNS to map the IP address to a fixed domain name. When clients connect via a browser using the fixed domain name, I send an HTML coded web page to the client.

What I want to achieve is a form/button submission on the web page which sends data back to the TCP server.

Ralph


#5

Hiya,

Can you do this with standard HTML and a normal web browser (i.e. apache)?

You are going to have to write your own ‘webserver’ from the ground up to run on the Wavecom module. Wavecom don’t have anything approaching a httpd server, and certainly no scribpting languages… You may be better looking at using Lua if you are not happy with having to code your own webserver.

In any event, I strongly recommend that you read HTTP made really easy to get an understanding of what’s involved in writing a web server…

ciao, Dave


#6

Thanks Dave, I’m investigating the possibilities of a LUA web server.

Let me also just add that when I say I want to send “data” to the TCP server, I actually mean that just a single character would suffice.

Thanks!