By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,285 Members | 2,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,285 IT Pros & Developers. It's quick & easy.

close() and write() on a socket.

P: n/a
I am trying to get some C code to work on .net C++ compiler

int writeDatagram(int sock, char *buf, int length) {
return write(sock, buf, length);
}

void killConnection(int sockd) {
close(sockd);
}

these functions are giving me the following errors
access.c(121) : error C2692: 'close' : fully prototyped functions
required in C compiler with the '/clr' option
access.c(121) : error C2197: 'close' : too many arguments for call
through pointer-to-function
access.c(132) : error C2197: 'close' : too many arguments for call
through pointer-to-function
access.c(238) : error C2692: 'write' : fully prototyped functions
required in C compiler with the '/clr' option
access.c(238) : error C2197: 'write' : too many arguments for call
through pointer-to-function
access.c(238) : error C2197: 'write' : too many arguments for call
through pointer-to-function
access.c(238) : error C2197: 'write' : too many arguments for call
through pointer-to-function

i thought these calls were refering to functions in #include
<winsock.h>, but I don't see them in there. although I did see a
closesocket() funtion.

Any ideas on getting this debugged. I'm not much of a network
programming expert and i'm new to vs.net.

Any help pointing me in the right direction is appreciated.

Nov 25 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.