Next Generation Emulation banner
1 - 11 of 11 Posts

·
Registered
Joined
·
128 Posts
Discussion Starter · #1 ·
I have got a project on "Lan messenger using data gram sockets".I m quite sure that it will be best to use Linux for this purpose but i am making some changes (i hope it will work) so that it will run on windows.following are the some C libraries i want.

errno.h
sys/socket.h
resolv.h
arpa/inet.h

These all exist on Unix platform .Do they exist on windows with the same name or their names are different.If they are on windows tell me site from where to download all these.

help me with this coz i m really worried abt this ..I have got few days for this.. :hdbash:
 

·
Transcended
Joined
·
1,416 Posts
rapscalion said:
Windows has winsock, which is a lot like BSD sockets with changes. Some of which are very obscure and annoying. Read a book on it.
Winsock ain't so bad.

@Sohaib
Wasn't this project started a long time ago? Anyway, grab some C source over the net. It's only too darn easy to find.
 

·
Registered
Joined
·
839 Posts
As windows doesn't support full-sockets on many versions except XP the UNIX sockets libraries won't work, thus you're stuck with winsock. I'd suggest perhaps finding a nice winsock wrapper like SDL_Sockets, as winsock is a pain in the ass to do anything useful with and not nearly as easy to use as UNIX sockets.
 

·
Transcended
Joined
·
1,416 Posts
He doesn't need full sockets anyway. Just basic UDP. I haven't done UDP in Windows, but seeing it's much simpler than TCP, he can get by.

Hm... Y'know... I've never really had a problem with Winsock. Threads under Windows without the Windows API, yes (infernal pthreads support...), but not sockets. Heck, I can do it in assembly if I wanted (with a great big IF :) ).

Do you have particular issues which you're concerned about? Any links on the subject matter? I find the problem interesting, since last I remember, the only thing you can't do in Winsock is Raw socket programming... which isn't really in the domain of most applications anyway.
 

·
Registered
Joined
·
907 Posts
This is interesting!
zenogais, when i try to get an overview of what SDL is capable, i end up with those two pages:
1. http://www.libsdl.org/cgi/docwiki.cgi/FrontPage?action=show&redirect=StartSeite

2. http://www.libsdl.org/index.php

regarding the frist page API section there are 10 API "Main-Sections" which are:
- General
- Video
- WindowManagement
- Events
- Joystick
- Audio
- CD - ROM
- Multi-threaded Programming
- Time
- Files

on which of these Topics i do find Network Programming / Sockets?

If u have usefull tutorial pagages regarding SDL and SDL Network Programming i would be happy if u could share them.

would be nice if u could help me :)

wbr Shin Gouki
 

·
Registered
Joined
·
839 Posts
Kraelis: merely stating facts, no need to take it personal. Windows until XP did not support the full TCP/IP stack, thus linux sockets weren't compatible before then. The only reason I dislike WinSock is because the last time I tried to use it I found it unnecessarily difficult to work with and poorly documented for the type of advanced things I was trying to accomplish.

That is about the time I picked up a book on Linux sockets and fell in immediately in love because they tied naturally into standard C input/output methods, it was a breath of fresh air after dealing with WinSock for so long. I'm sure WinSock is a perfectly capable library, but its just not as easy to use as some other options.

Shin_Gouki: I apologize, I didn't get the name right, it is called SDL_net. Also, you are aware SDL has many extension libraries right? SDL_net is one of the extension libraries and can be found here. Also a quick google search turned up some other cross-platform networking libraries:

  • ACESTL - Cross-platform C++ STL-compatible sockets library
  • OpenTNL - C++ again, nice library, very advanced.

Of the three i've recommended SDL_net is by far the easiest to pickup and use and most accessible. Anytime I have to do networking I pretty much use SDL_net because it avoids alot of headaches. Hopefully this has helped.

Also, the SDL_net homepage allows you to browse some sample sources which show how to use both TCP and UDP. You can find it here
 

·
Transcended
Joined
·
1,416 Posts
zenogais said:
Kraelis: merely stating facts, no need to take it personal.
zenogais said:
Windows until XP did not support the full TCP/IP stack, thus linux sockets weren't compatible before then.
Oh don't worry, I'm not. I just wanted to find out more in case I was missing something there.

You see, I didn't mind that Windows didn't support the full TCP/IP stack. This came from days back then when the issue of raw sockets under Windows was rife. Allowing raw socket support entailed carrying a security risk. A script-kiddie-hacker-wannabe needed to have enough brains to get a Linux box running in order to exploit this, and I sure wasn't really willing to make it any easier for just any idiot to make lives worse.

Microsoft pushed for it since there was a "demand" for it. So I was hoping to find someone who can explain to me a substantial benefit/reason for the full TCP/IP implementation. Like I said, I personally found no good use for it so far.

zenogais said:
The only reason I dislike WinSock is because the last time I tried to use it I found it unnecessarily difficult to work with and poorly documented for the type of advanced things I was trying to accomplish.
Amen. We both agree on that. If I really needed to get something done for the net, I'd rather have it done under Linux sockets anyway. Academic bias. :lol:

Btw, thanks for the heads up on the SDL wrappers. Might come useful someday. I like cross-platform compatibility, and the wrapper would really help.
 

·
<B><font color="lightyellow" size = "1">A BIG BAD
Joined
·
5,568 Posts
zenogais said:
The only reason I dislike WinSock is because the last time I tried to use it I found it unnecessarily difficult to work with and poorly documented for the type of advanced things I was trying to accomplish.
http://jcatki.no-ip.org/SDL_net/
You don't really need a lot of documentation if your just implementing it using the plain vanilla socket api (i.e. select, recv/send etc). When you start programming using overlapped I/O or the asynchronous event model, it might be a pain if you've never encountered them before. That said, I think I probably spent some time cursing at my PC when I did my first 'simple' server using the IO Completion port model (only available in win32). Basically because of what you stated, lack of documentation and because of the counter intuitive implementation. In the end I had to go find a good reference for it. All in all though, winsock wasn't THAT bad :)
 

·
Registered
Joined
·
907 Posts
yes of course most APIs ain´t that bad <<IF>> u find a good reference for it.
Problem: Find "good" references for <every> API

Problem Description / estimates :
(My point of view)

When a API is develloped, every programmer has to learn from scratch how to use , in some cases the engineer from the API give some example.
But in general u have to learn urself when u want to use. Once u completed u learning ur basicly finished with the topic. U have gained "tacit" knowledge about the subject.

Solution:
Lets Consider there is (for every API!) a media (always on service) where u can put into ur tacit knowledge. Further more u will write ur experience into this media.
(here we consider that u only write things into this which are NOT yet listed there)

What do YOU / WE gain from this?

If u "ever" have to work again on the topic, u dont have to search because ALL refreneces and knowledge is gatherd there (concerning the Topic of a specific API)
Even if u think it might be hard work to write down ur knowledge, think about that it would be nice if ur starting AGAIN with a new API, u can use such a resource.
Some very nice Attributes of this miraculous media:
- Information access is structures thus u can learn fast
- u´ll get reference to GOOD papers/books, websites concerning the topic
(but most important -->)
- personal experience of many programmers is depicted here
- and u can read it for free :)
This media is called a wiki :)
In the beginning the knowledge level of every API might not be very high but as we consider that people with knowledge are kinda eager to share their knowledge/ correct wrong facts.

I don´t tell anyone to create a wiki here for Winsock,
what i was think was a little bit smaller ( yet will grow bigger)
A wikki for emulation Programming.
This wikki would be for ALL interested people, including those which cant programm.
The outline would go kinda:
1.- the knowledge about tools:
-- programming language: --> what language to learn?
-- what is an API
-- etc
2.- the knowledge how to <<use>> ur tool knowledge
-- what are the basic concepts of an Emulator: interpreter / recompiler..etc
-- what are the essential parts of an emulator: memory subsystem ...etc

As u can see nothing of this is new or unkown it "simply" hasn´t been put togehter yet.

What do u need to put it together? :)

Host for the Wiki and Content for the wiki:
Emuprogrammers, and i think we got some of them here ;)
Now some of the Coders might think: what a crazy chick: we have SOOOO lesss time and he wants us to waste it even more what a fool -_-°
BUT if u consider it seriously there are only benefits from it because u´ll gain in the end time AND knowledge from it, why?:
1. every "stupid" question can be answered with: take a look inside the wiki
2. every "interesting" question can be discussed, thus u learn about topics u are interested in

If ur interested, lets discuss this further :)

wbr Shin Gouki
 

·
Registered
Joined
·
128 Posts
Discussion Starter · #11 ·
Thankx guys.I am just about to complete my project.I hve found it easy to use Linux Red hat 9.Its pretty good in these sort of things.I m not using UDP coz its very simple for a whole year project.I m using Stream Sockets and these days i m finding how to add multiple client support .

Well as for late reply so i wasn't expecting any answers from any of you coz last time i wrote nobody dared to reply.But anyway thankx a lot to u guys....
 
1 - 11 of 11 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top