Winsock network c++ - winsock

I want to learn winsock network programming in C or C++ . but I don't know
which tutorial to learn .
I've found this tutorial http://beej.us/guide/bgnet/html/single/bgnet.html but the author is using UNIX .I don't know if the code in this tutorial will compile without errors on windows.
I've downloaded Network Programming for Microsoft Windows , Second Edition (Microsoft Programming Series) book but it has no c++ section ...... any help ??

The "Network Programming for Microsoft Windows" is a good resource to start socket programming under Windows.
The winsock library is a plain C library including the Microsoft extensions to the Berkeley socket function set. You cab use winsockets and link the C import library to you C++ application. The header files are prepared for C++ so that you don't have to enclose them in #ifdef __cplusplus guards.

Related

gdb: how to write my own simulator module for gdb and integrate it with Eclipse (assembly only)?

I found good videocource on programming languages and low-level programming # SEPL Goethe University Frankfurt
But their's toolchain looks strange: 2OPM source only, x86-64/MISP specific.
I want to make my own simple 32-bit VM in form of DBG simulator module, assembler, integrate it with Eclipse/GDB, and adapt this cource for this VM.
What GitHub projects can I use as samples ?
PS: This system must compile/run under MinGW32 -- Is I need GDB sources for my simulator compiling ?

Which programming language(s) is Ulteo OVD written in?

I am doing on an academic project Virtual Desktop Infrastructure. I want to work with Ulteo OVD 4.0.2 which is an open source virtual desktop software. But I am not aware in which language is Ulteo coded. Can you please tell me?
Look inside their git repository: it is mostly C, with some Python & Java (client side ...), configured by autoconf
A general hint about free software is to download the source code and look inside it.

STM32 libraries for eclipse

Can you use the CMSIS, HAL, TM libraries for STM32F407 discovery board with eclipse, without STM32Cube? According to this link http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/ you can do it with eclipse & STM32Cube. But I wonder if you can do just same thing without the STM32Cube. Since I'm using OS X, it is impossible to install the STM32Cube, but in order to use the GPIO library I need to use CMSIS, HAL, TM libraries.
You might be able to used the older "Standard Peripheral Driver" model - which was a just a distributed set of driver files specific to the chip. These libraries are no longer supported and are replaced by STM32Cube which generates equivalent code - but with better support for hardware abstraction however they are still very useable.
Search "STM32F4xx_StdPeriph_Driver" to locate the libraries (which include the standard peripheral drivers and CMSIS).
You can download the libraries as a separate zip file
http://www.st.com/web/en/catalog/tools/PF259243
just unpack it and import whatever you need from it into your project. You can take an example project which is closest to your needs, and start developing your application from that. That's what I did in Linux.
There is the STM32CubeMX, which is the installable program you're referring to, and there are STM32CubeF4, STM32CubeL0, etc, which are the firmware package for the different controller families.
CubeMX now officially supports Mac and Linux. However here is an old post how to run it manually http://www.carminenoviello.com/2015/09/09/running-stm32cubemx-macos-finally/.
Regarding the HAL and SPL I'll add that there are really nice libraries in libopencm3 which are developed by community and are not so "buggy" as HAL or SPL.
I found an interesting instruction. You can install the STM32CubeMX on OS X. http://www.stm32duino.com/viewtopic.php?t=267
There is an Eclipse based IDE by OpenSTM32 community called SW4STM32. Available at OpenSTM32 community's site. System Workbench for STM32 installer has been released on the following platforms:
Microsoft Windows Vista and newer (32 bits or 64 bits)
Linux (32 bits or 64 bits)
Mac OSX 10.10 Yosemite and newer + Xcode 7
Java SE JRE 7 or newer
When creating a project you can choose which library you want want to use, SPL, HAL or baremetal.
STM32CubeMX is a initialization code generator. It definitely eases development, but you can write you code completely from the beginning.
STM32CubeMX uses HAL as its Library. You can download the HAL and Include the files that you need and write down the code from scratch. You just need to be aware of the APIs, which are documented in UM1725 Application Note.
But, now STM32CubeMX is also available for Linux and Mac.

Can I use Indy Sockets in Visual C++?

I would like to port Borland(Embarcadero) C++ Builder 2010 project to Visual C++. The hurdle is Indy Sockets library. It works great, but I need it on Microsoft native stack (not managed C# port).
Simply pulling Indy includes into VC++ project ends up ugly with stuff like:
#if __BORLANDC__ < 0x500
#error BCW 5.0 or greater required
#endif
or
#pragma delphiheader begin
and doesn't compile...
Is it even possible?
-Stan
Indy is written in Delphi Pascal, and as such can only be compiled with a Borland/CodeGear/Embarcadero or FreePascal compiler.
Indy 10 supports .NET, but its .NET assembly binaries have not been recompiled in a long time (you would have to use a Delphi.NET compiler to compile the latest code from Indy's SVN). Indy 11 will likely drop support for .NET, though.
In order to use Indy in a Visual C++ environment, you will have to wrap it inside of a Delphi/FreePascal-written DLL first.

How to build software that doesn't require a framework on the user's machine?

I am an ASP.NET developer, but now I want to build a software that can be installed on my PC. Software built in .NET platform only works when the .NET Framework is installed, and software written in Java only works if the JDK is installed. When I install programs like Firefox, uTorrent, etc., I don't need to have any frameworks (.NET, JDK, etc.) installed. How do I write software that doesn't depend on a framework?
You will have to use a language that isn't dependent on a framework or otherwise only target clients that are already have your framework installed.
If you chose C or C++ for example, you would distribute binaries to your client that contained machine code. This code would not be dependent on a runtime environment (like C# or Java) or an interpreter (like Python or Ruby). This is the way that applications like Firefox and uTorrent are written.
"When I install programs like Firefox, uTorrent, etc., I don't need to have any frameworks."
Actually, you do. They just tend to use the C++ frameworks, such as MFC, some of which are already installed. Even then, there are installers for these frameworks that are included with other application installers (usually called Microsoft Visual C++ 2008 SP1 Redistributable Package or something like that. See Also: Visual C++ Deployment).
Now, having said that, they don't require a virtual machine (like a JVM for Java or a CLR for .NET), because C++ compiles down to x86 / x86-64 machine language to be executed directly by the operating system.
Fundamentally you always have a "platform", which is the operating system. Traditionally if you want to write code that will run on multiple operating systems you would use a fairly portable language such as C++ that produces native executables for a target operating system. Still, there are differences between how different operating systems work. There will therefore be parts of the C++ (or other portable language) code that are specific to that OS. You try to isolate those parts as much as possible to minimize the effort to port between OSes. Still, that effort is typically very substantial. You are also limited to the least common denominator of features available on all target operating systems (unless you create a custom version for a given OS that exposes its special features).
This is complex, time consuming and expensive. That's the reason technologies such as Java and .NET were created.
If You want to build really platform independent software You will finally end up with solution like Java Runtime or .NET. What You could do, You could thing about writing application in such way that You are able to compile/run it on most known platform, and of course then You need middleware to translate Your application's objects into platform objects (functions, whatever...).
I have seen solutions made in Pascal for DOS in such layer of abstraction that with little effort it was moved directly to Delphi for Windows without touching application logic.