aspose file tools*
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 Soft Skills this week in the Jobs Discussion 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: 635


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: 19059
    
  40

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: 635
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: 19059
    
  40

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: simple socket question