Writing my own socket functions
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Writing my own socket functions




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Writing my own socket functions  
chris


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-04-04 10:52 PM

As a project I want to attempt to rewrite the socket(), connect(),
send() and recv() functions and was wondering if anybody can point me in
the right direction.





[ Post a follow-up to this message ]



    Re: Writing my own socket functions  
Måns Rullgård


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-04-04 10:52 PM

chris <chris@misery.net> writes:

> As a project I want to attempt to rewrite the socket(), connect(),
> send() and recv() functions and was wondering if anybody can point me
> in the right direction.

Why would you want to do that?  They are just thin wrappers around the
corresponding system calls.

--
Måns Rullgård
mru@kth.se





[ Post a follow-up to this message ]



    Re: Writing my own socket functions  
chris


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-04-04 10:52 PM

Måns Rullgård wrote:

> chris <chris@misery.net> writes:
>
> 
>
>
> Why would you want to do that?  They are just thin wrappers around the
> corresponding system calls.
>

Wouldn't I be able to emulate connect(), send() and recv() in userland
with a raw socket (ie. construct my own SYN packet for connect())? The
one I'm really unsure about is socket().

As for "Why?", it's just for fun and to learn.





[ Post a follow-up to this message ]



    Re: Writing my own socket functions  
Måns Rullgård


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-05-04 07:49 AM

chris <chris@misery.net> writes:

> Måns Rullgård wrote:
> 
>
> Wouldn't I be able to emulate connect(), send() and recv() in userland
> with a raw socket (ie. construct my own SYN packet for connect())?

I suppose you could.

> The one I'm really unsure about is socket().

You'd need the system socket() to get the raw socket.

> As for "Why?", it's just for fun and to learn.

That's always a legitimate reason.

--
Måns Rullgård
mru@kth.se





[ Post a follow-up to this message ]



    Re: Writing my own socket functions  
chris


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-05-04 10:53 PM

Måns Rullgård wrote:

> chris <chris@misery.net> writes:
>
> 
>
>
> I suppose you could.
>
> 
>
>
> You'd need the system socket() to get the raw socket.
>
> 
>
>
> That's always a legitimate reason.
>

I have a new idea: I can write directly to a BPF device, and won't need
to use the true socket() function. My socket() function can simply
return a structure with the BPF file descriptor and anything else I
need. Feedback?





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:42 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register