473,703 Members | 3,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Socket programming using Visual C++ .Net

Hello,

I am trying to compile a class that uses socket using the Visual C++
..NET compiler. I get the following error:

------ Build started: Project: infCommon, Configuration: Release Win32
------

Compiling...
cl : Command line warning D4029 : optimization is not available in the
standard edition compiler
infSocketObject .cxx
c:\ILS\inFACT\C ommon\infSocket Object.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infServerSocket Object.cxx
c:\ILS\inFACT\C ommon\infSocket Object.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infObjectUsingS ocket.cxx
c:\ILS\inFACT\C ommon\infSocket Object.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infClientSocket Object.cxx
c:\ILS\inFACT\C ommon\infSocket Object.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
Generating Code...

Obviously, the #include<sys/socket.h> is the issue... but why is that
??? Is it because Visual C++ .Net does not support standard socket
programming ??? I actually checked in the include directory of Visual
C++ .NET and was unable to find any trace of the socket.h file.

Any help would be appreciated.

Regards,

Jean-Philippe
Jul 22 '05 #1
2 13735

"Jean-Philippe Guyon" <pi****@yahoo.f r> wrote in message
news:28******** *************** ***@posting.goo gle.com...
Hello,

I am trying to compile a class that uses socket using the Visual C++
.NET compiler. I get the following error:

------ Build started: Project: infCommon, Configuration: Release Win32
------

Compiling...
cl : Command line warning D4029 : optimization is not available in the
standard edition compiler
infSocketObject .cxx
c:\ILS\inFACT\C ommon\infSocket Object.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infServerSocket Object.cxx
c:\ILS\inFACT\C ommon\infSocket Object.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infObjectUsingS ocket.cxx
c:\ILS\inFACT\C ommon\infSocket Object.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infClientSocket Object.cxx
c:\ILS\inFACT\C ommon\infSocket Object.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
Generating Code...

Obviously, the #include<sys/socket.h> is the issue... but why is that
??? Is it because Visual C++ .Net does not support standard socket
programming ??? I actually checked in the include directory of Visual
C++ .NET and was unable to find any trace of the socket.h file.

Any help would be appreciated.


Your question is not about ISO standard C++, the only topic here.
You need to ask about this in a Visual C++ newsgroup, e.g.

microsoft.publi c.dotnet.langua ges.vc

If your news server does not have this group, connect your news
reader to Microsoft's public news server, msnews.micoroso ft.com

Purpose of comp.lang.c++:
http://www.slack.net/~shiva/welcome.txt

-Mike
Jul 22 '05 #2
Hello Jean-Philippe,

you are right when you say that including <sys/socket.h> is the
problem. This is the header file used for *nix based systems. Windows
has implented their own version very similar to the BSD sockets API.
The include file for this is simply <winsock2.h>. You will also have
to link the WS2_32.lib to your program. This can be done in the
project settings menu. Another issue of importance is the way that
the API is implemented. Even though it is very similar to coding
sockets on other systems, it still has its differences. For example
you must call WSAStartup() before you even call socket(). Once you
see the code however you should be more than comfortable with coding
sockets in windows. Just search the web and you'll find what you
need.

Good Luck,
Kevin Mooney
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3680
by: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose but have been unsuccessful in finding the answers so far. Either because my understanding of sockets isn't where it needs to be or my questions are too basic. My programming environment is Windows XP, Visual Studio .NET 2003 and C#. So here it...
9
8669
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am trying to decide if I should use remoting vs. writing a server that uses networkstreams. I have read that networkstreams\tcp programming should be faster than remoting and is a better choice for what I am doing but that it is difficult to code.
2
2708
by: Sandy | last post by:
Hi All, I'm a newbe to socket programming, I need to work on a project that has to be developed in C++ or Visual C++ ( I have 8.0 version) console application. which will be execute from a Java GUI application using dos command and pass a userid, password and a port number( to connect back to Java GUI using TCPprovided ) using the user and password information I need to connect to a vendor using there API and get the information from the...
8
4673
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi all, I am new to .net technologies. ASP.NET supports socket programming like send/receive in c or c++? I am developing web-site application in asp.net and code behind is Visual C#. In page_load event, I am using atl com component. Here one for loop is there. In this for loop, number of iterations are 1000, I can receive some data using com component. It is just set of some characters like
5
3301
by: gnanapoongothai | last post by:
hi, i am a beginner in socket programming in vc++. There is error poping up when the addr of the socket is compling, .\simple_socketsever.c(41): error: identifier "sockaddr_in" is undefined sockaddr_in service; ^ .\simple_socketsever.c(41): error: expected a ";" sockaddr_in service; ^
2
2838
by: maxpa1n | last post by:
Hi i am a software developer and i need to use .NET 2.0 with C#. I am using Visual Studio 2005 Professional and Windows Vista Ultimate as the development eviornment. I have a programm that uses the System.Net.Socket.Socket class. So i have init a UDP socket like socket with the
0
872
by: Rii | last post by:
Hi I m bigner in socket programming using asp.net & c#. I hv made one simpl client-server appl'n. hw can I get data(which is sent by srvr/client) in receive textbox(of client/srvr) without generating any event... plz do hlp me......... Thanx in advanc.....
7
2435
by: nagasrinivas05 | last post by:
hi, this is srinivas here i am using socket programming to send data to a remote computer using clssocket with namespace system.net and it is working well, but when i am sending continuous data in a packet format to one more remote computers there i am facing the problem of mixing status one packet format is #010211* other is $010228&&&&1111* using visual studio 2005 , oracle 10g when continuously sending the packet data is been mixed ...
5
1337
by: Radz | last post by:
Make a project that creates a message box with the following features • The text to be displayed on the message box should be Visual Programming First Assignment • Title appeared on the message box should be University Of Pakistan
0
9243
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7853
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5922
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4420
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2434
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2057
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.