/Simple-Packet-Echo

A simple talker/listener that echoes a message to a bound port

Primary LanguageC

# Simple Echo
by Oscar Sanchez

This project contains a simple talker and listener program that, given
a message, will talk to a port through a host, and send a message that
will be picked up by the listener program and echoed back.

## Installation

The project is in C; I've included a simple Makefile, so to install it, just run
"make" in the directory.

Note: This won't work on Windows, because I'm using the linux libraries and not
winsockets. Though if you'd like to run this in windows, just change the library
used at the top of the talker.c and listener.c files.

## Usage

```bash
talker [-v] -p port -h host message    
listener [-v] -p port
```

## Description

`listener` binds to the given UDP port, listens for a packet
and echos it back to the source port and source IP.

talker sends the given message in a UDP packet to the given
port and host, then listens for a packet on port that its
socket was bound to. It prints out the contents of the returned
packet to stdout.

The verbose option (-v) will have the listener and talker
print to stdout the source and destination port and IP of 
the packets that arrive.
    
## Example Use

On one terminal:
`$ listener -v -p 8080`

On a second terminal:
`$ talker -v -p 8080 -h localhost 'Hey there, coder!'`