[SDL] SDL_net and socketpair

Neil Griffiths n.griffiths at virgin.net
Thu Sep 5 16:28:00 PDT 2002


Hello Bob,

BP> Lets step back and think about this for a moment. I see why you would
BP> want to use socketpair for the application that was mentioned. But, is 
BP> this really something to add to SDL_net? Or, should we be thinking about 
BP> an new library, SDL_process, that provides the functionality of fork, 
BP> exec, popen, and interprocess communication? I think we could come up 
BP> with a small set of APIs that are both portable and cover the need to 
BP> create processes and communicate with them. I guess what I'm saying is 
BP> that there isn't much point in having a portable version of socketpair 
BP> if there isn't a portable fork or popen or what not.

That makes sense. I was thinking about SDL_net because of sockets, but
you have a point there. Perhaps a better name would be SDL_system? But
either way, the name isn't important - the idea is.

I'll certainly write a socketpair() replacement very quickly, I'll get
it done at the weekend as a bit of a break from GBA programming. But
the rest of it would still need to be written. Would you be interested
in helping?

BP> Personally, I would prefer an API like popen that gives me a 
BP> bidirectional connection to the new process. I know how to do that with 
BP> standard Unix APIs, but it would be so nice to have one simple API to do 
BP> the job.

Yes, you're right. I've been using popen() when writing a server at
work and found pthreads quite nice. I never needed bidirectional
connections because of the modular design, but I can definitely see
where it would be useful!

Neil.





More information about the SDL mailing list