Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8825073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:47:26+00:00 2026-06-14T06:47:26+00:00

So for our first assignment we made a basic ftp program using TCP, now

  • 0

So for our first assignment we made a basic ftp program using TCP, now we have to modify it to use UDP, also sending it to a router program (that we cannot modify, but have the code to look at) that will randomly drop and delay packets and handle it with a simple stop and wait protocol. But that’s not the problem.

I modified the Client and Server to use UDP using the notes from my lab teacher (http://www.cs.concordia.ca/~ste_mors/comp445/Assign2tutorial.ppt) and all I’m doing is sending a packet and when I receive it on the other end print a line of text. I followed the instructions in the slides, running it on localhost (have no other machines to test with) and it sends, and the router confirms it receives and forwards the packet, but the server never prints the line of text. Knowing that UDP drops packets a lot I made a while(true) loop that sends packets forever, the server still does nothing.

Here’s the code so far:
Client: http://pastebin.com/XdbxuJ9R
Server: http://pastebin.com/iN5j2Ku3
Unmodifiable Router given to us: http://pastebin.com/QwMAc0MW

For the client i left in everything after the connection starts from the old one, the send line is 175, in server I commented out everything in the run loop except the receive part which is at line 181

I’m going absolutely crazy trying to fix this. I had to cancel plans and ruin my entire day because I can’t get this one thing working. 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:47:29+00:00Added an answer on June 14, 2026 at 6:47 am

    From what i can tell you’re using the wrong ports. Here’s what the router.h defines:

    // router.h
    #define ROUTER_PORT1 7000 //router port number 1
    #define ROUTER_PORT2 7001 //router port number 2
    #define PEER_PORT1 5000   //port number of peer host 1
    #define PEER_PORT2 5001   //port number of peer host 2
    

    And here’s what you’re defining:

    // client.cpp
    #define REQUEST_PORT 0x5000 // hexadecimal, that's port 20480
    

    and

    // server.cpp
    #define REQUEST_PORT 0x5001 // hexadecimal, that's port 20481
    

    I didn’t check the rest of the code, but the server appeared to receive something after correcting the port numbers (as in removing the 0x prefix)

    Maybe this will help illustrate how the router works:

    // the router does (pseudocode):
    recvfrom(7000), sendto(PEER2:5001)
    recvfrom(7001), sendto(PEER1:5000)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok so for an assignment we have to make our first program. Mine is
I have to use SQLPLUS for my database class, and our first assignment is
In my assembly language class, our first assignment was to write a program to
We just got our first major Perl CGI assignment in my CS class. Our
My team is building our first significant Silverlight application, using a 3 layered architecture
Suppose I have a dropdown (select tag) with 3 values. Our first option has
I have just started the Assembly language programming and in the first lecture our
Our team is developing our first web api and using Service Stack to expose
We are using our first website that will give the users the choice of
We're trying to configure our first server and we would like to have maven3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.