Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to read and write to/from webserver socket?

 
Siegfried Heintze
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic