INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Send tcp packet from receiver to sender using winsock API in Powerbuilder 12.5

Send tcp packet from receiver to sender using winsock API in Powerbuilder 12.5

Send tcp packet from receiver to sender using winsock API in Powerbuilder 12.5

(OP)

Hello!,

As I have to implement some winsock services in our Powerbuilder 12.5 project I have the following issue:

Suppose we have sender S that sends ( initiate communication ) data to receiver R. How can R identify the channel ( IP and port ) of sender that sender uses in order to send back to sender a reply ?

Thank you in advance for your time and cooperation.

John.

RE: Send tcp packet from receiver to sender using winsock API in Powerbuilder 12.5

Take a look at Roland Smith's free winsock example Here

Just migrate it up to 12.5 and give it a look.

Matt

"Nature forges everything on the anvil of time"
www.anvil-of-time.com

RE: Send tcp packet from receiver to sender using winsock API in Powerbuilder 12.5

(OP)
The point is that I want the listener application to send back a message ( let's say 'Hello!' ) to the sender's application, without knowing the actual IP and port. So I want to find a way to discover sender IP from the listener application. Let's say that I want to answer back to the same channel that initiate the communication from the sender part. How can this implemented with Roland Smith's winsock example ?

Thanks!
John.

RE: Send tcp packet from receiver to sender using winsock API in Powerbuilder 12.5

If you take a look at my example that he gave the link to, it does just that. I have a function to get the IP address of the remote computer but you don't need to know the IP address of the remote computer to reply.

Download the example and open the object u_tabpg_tcpip_listen. Look at the event ue_listen. FD_ACCEPT is the program accepting the connect request. You can see a call to of_GetPeerName which gives you the IP Address. FD_READ is the program receiving the sent data via a call to of_Recv. Then it calls of_Send to send a reply. Open the object u_tabpg_tcpip_send and look at the clicked event of cb_send. First calls of_Send to send the data and then calls of_Recv to receive the reply.

The example comes in PB8 and PB10 versions. You can migrate the PB10 version to PB 12.5.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close