This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes simple socket question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "simple socket question" Watch "simple socket question" New topic
Author

simple socket question

abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 606


The object that is returned by accept(), Is an instance of socket class in client ?

or socket class in server?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18116
    
  39

abalfazl hossein wrote:
The object that is returned by accept(), Is an instance of socket class in client ?

or socket class in server?


Not exactly sure what you are asking here... a socket instance represents an endpoint of the network connection. So the socket at the server and client are the opposite endpoints to the same connection. Please elaborate what you are asking.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 606
OK. Then a connection is established . The socket object that is returned by the accept method, Is that object is created in server or client?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18116
    
  39

abalfazl hossein wrote:The socket object that is returned by the accept method, Is that object is created in server or client?


Oh, I see. The object is created locally. There is no serialization taking place.

Remember that the socket mechanism calls the underlying socket mechanism, implemented by the operating system -- and operating systems are, for the most part, not object oriented.

Henry
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: simple socket question
 
Similar Threads
NIO non-blocking newbie
reading from TCP socket problem
Singleton/Static in Multi threading scenario
Successful Applet Socket Connection
simple socket programming