• Post Reply Bookmark Topic Watch Topic
  • New Topic

SSL Server and Client Communication  RSS feed

 
Ajay V Krishnaprasad
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i'm a newbie in socket programming. i'm trying to implement client n server which could send and receive messages continously, unless one of them closes the socket.

this is the construct that i'v been able to come up with for server n client-

Server:



Client-


------------------------------------------------------------------


Whenever I try to run this both server and client hang.....

I tried closing the socket after a read (at server) and write( at client).....then creating new one for the other pair of I/O operations....that works.....
but, I wanna do it using a single socket connection at a given port....

assuming I'll be using server n client on the same type of OS, I'm using buferred I/O......

Could anyone suggest me way or gimme the basic construct of server n client to implement the above prog?

Thanks,
ajay
[ October 16, 2008: Message edited by: Ajay V Krishnaprasad ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Does it work if you don't use buffering?

Also, the Java Tutorial has a complete example of socket client and server.
 
Ajay V Krishnaprasad
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried it using writers too....havn't been able to make any progress....

will look into the tutorial
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!