• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

socket programming on 2 ports

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
How do I program a client application where the server communicates on 2 ports: it listens on 1 port and sends messages on another port.
It is urgent
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,
When you want to receive data on one socket and send data on the defferent socket then i would say let your client and server have both client socket and server sockets .
Client application will have server socket and client socket capability.
Server application will have server socket and client socket capability.
I mean like open a server socket on server and listen for client. once the client makes a connection to server send information of the client(like its the host Ip and port where it listening ) and now server will use this information(ip and port of the client) and connects to the client. so this way one socket can used for sending and another can be used for receiving.(This type connection is used by CuteFTP if i am not wrong).
This is best way what i can thing of, as we also used such type of communication.
hope this helps
Mallick
 
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Srinivas
i,am trying to do what have a suggested but in vain . PLease have a look
https://coderanch.com/t/205848/sockets/java/chat-server
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic