Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

simple socket question

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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

or socket class in server?
 
Henry Wong
author
Marshal
Pie
Posts: 20989
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 20989
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic