aspose file tools*
The moose likes Groovy and the fly likes How to read and write to/from webserver socket? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "How to read and write to/from webserver socket?" Watch "How to read and write to/from webserver socket?" New topic
Author

How to read and write to/from webserver socket?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381

How do I modify http://pleac.sourceforge.net/pleac_groovy/sockets.html#AEN925 to print out what the browser sends it?

Here is my attempt:


I get this error:

Exception thrown: Address already in use: JVM_Bind

java.net.BindException: Address already in use: JVM_Bind

at ConsoleScript3.run(ConsoleScript3:1)

Thanks,
Siegfried
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The error is unrelated to what you're asking--there's something already using that socket.

Perhaps your own app, since it never exits.
Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 381
If I comment out that one line where I try to read the socket, I basically have the original that works. This leads me to believe my attempt to read is causing the problem.

So, how do I take the original and enhance it to display all the post parameters and the header that the browser is sending it?
Thanks,
Siegfried
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to read and write to/from webserver socket?