Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #8349

Re: Raw Socket programming

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.programming
Subject Re: Raw Socket programming
Date 2018-02-04 19:31 +0000
Organization A noiseless patient Spider
Message-ID <87bmh4y2kr.fsf@bsb.me.uk> (permalink)
References <bd0670e2-5bd8-4a5f-ab61-d79ac57566a9@googlegroups.com>

Show all headers | View raw


Ilias Abrams <iliasabrams@gmail.com> writes:

> I want to configure and send a simple packet (TCP or UDP) between two
> devices in a local network using static IP configuration.

A simple packet suggests UDP.  TCP is a stream protocol.

> Can anyone explain me / describe to me the logical process in bullets
> style what I need to programming.

What system and what language?

On Unix-like systems the low-level outline for something like a C
program is:

For the receiver:
  Create a socket.
  Call bind with a zero address to associate a local IP address with it.
  Call listen to indicate that the socket is read to accept data.
  Wait for data using something like select.

For the sender:
  Create a socket.
  Call bind with the destination address.
  Use send to send (or write) to send a datagram.

(Note: It's been a while, so you will have to check this.)

-- 
Ben.

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Raw Socket programming Ilias Abrams <iliasabrams@gmail.com> - 2018-02-04 07:39 -0800
  Re: Raw Socket programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-02-04 19:31 +0000
    Re: Raw Socket programming Chad <cdalten@gmail.com> - 2018-02-05 17:49 -0800

csiph-web