• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

SSL Server and Client Communication

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried it using writers too....havn't been able to make any progress....

will look into the tutorial
 
I'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little ad
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic