PDA

View Full Version : how does bind() work in relation to a client.


BinarySpike
2006.08.23, 02:04 AM
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

OneSadCookie
2006.08.23, 04:00 AM
The client doesn't call bind.

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.

BinarySpike
2006.08.23, 10:30 AM
The client doesn't call bind.


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


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.

OneSadCookie
2006.08.23, 05:44 PM
"UPP" stands for "universal procedure pointer", and is a hangover from the days when the Mac Toolbox was Pascal.