how does bind() work in relation to a client.

Member
Posts: 277
Joined: 2004.10
Post: #1
What is bind() in relation to a client? bind from BSD sockets.

I cannot seem to get it to work with a client when I pass 127.0.0.1 as the host.
(from the sockaddr)

Server works fine, but I tried and bind returned -1 and perror gave me an undefined error.

(I have no clue why a bind() would not work... it does not even know when I call it if I am gonna run a server or client)


Little info, I am writing a networking class that encapsulates: types, timestamps, and packet length. I am also thinking of implementing ACK packets.

Base class is BinSocket derived are BinServer and BinClient.

I wanted to know because I do not know if I need to stick the local Bind() function in BinSocket, where BinClient can access it, or in BinServer.

By the way, the client works like a charm... very hightec... if you do not mind Procedures... aka function pointers. I have not tested BinServer although the code compiles without as much as a warning. I also still have to put winsockets in... should take seconds want to get the server running though.

Thanks,
-BinarySpike

Global warming is caused by hobos and mooses
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
The client doesn't call bind.

BinarySpike Wrote:if you do not mind Procedures... aka function pointers

No, procedures are not also known as function pointers. Procedure is most often a Pascal term referring to a function without a return value.
Quote this message in a reply
Member
Posts: 277
Joined: 2004.10
Post: #3
OneSadCookie Wrote:The client doesn't call bind.

Hmm, ok... I guess bind is related to the server as connect is related to the client.

Quote:No, procedures are not also known as function pointers. Procedure is most often a Pascal term referring to a function without a return value.

Blush
That's not what the classic toolbox thought... LOL

Ok well thanks... this should be done pretty soon then.

Global warming is caused by hobos and mooses
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
"UPP" stands for "universal procedure pointer", and is a hangover from the days when the Mac Toolbox was Pascal.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  P2P or Client/Server? TokyoDan 2 4,682 Aug 3, 2009 06:15 AM
Last Post: georgiph
  Client side prediction in a networked top-down game AndyKorth 0 3,979 Jun 30, 2009 08:35 AM
Last Post: AndyKorth
  Subversion Client BeyondCloister 8 4,166 Jun 7, 2006 01:04 PM
Last Post: ravuya
  Need help porting an MMORPG client Radu 62 28,845 Mar 31, 2006 11:47 AM
Last Post: igame3d
  host-client matchmaking "server"... dave05 3 4,328 Sep 15, 2005 04:03 PM
Last Post: Steven