473,609 Members | 1,900 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 13727

"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
3678
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
8665
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
2701
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
4670
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
3299
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
2833
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
2434
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
1334
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
8129
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8571
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
8535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8404
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...
1
6056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5509
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
4080
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.