Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem writing object on a socket  RSS feed

 
Nirmal Mekala Kumar
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using ObjectOutputStream to write out an object from server to the client. When I run both server and client on the same system, the program works fine, but when i run them on different servers the writeobject method of the object stream freezes. the program does'nt move past this method.
Can someone tell me if its a security issue ( I have disabled all the firewalls on both the client machine and the server).
 
Paul Santa Maria
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could well be a security issue. I had a similar problem once where I *thought* I opened all the ports I needed in all the firewalls on my segment ... when I discovered that my A/V software happened to have it's *own* firewall (that was blocking the port I wanted to open).

The first thing to do is verify you can "connect" a) between the hosts in question, b) on the specific port you're using. If you can't, your program should fail with an error long before you try to "write" anything (maybe you're getting a "connect" error, but your program is inadvertantly masking it?)

You might consider installing something like "Ethereal" (Open Source: Linux, Windows and most flavors of Unix) and take a network trace. You can also use the "telnet" command to verify whether or not you can "connect" to a given port on a remote host.

'Hope that helps .. pSM
 
Nirmal Mekala Kumar
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm checking for the ports to be open and they are fine. Infact I initially send an Integer object on the port to test if ObjectOutputStream on that port works. That part is working fine. So it is not a problem of ports being closed.
I think the problem is either with my class or java security policy. Can you tell me if java security manager has rights to block certain classes from being serialized or sent on the network. If yes, how do i check if a certain class has been blocked by the security manager
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!