Jump to content

send message to a server port


snk

Recommended Posts

Hello, I would like to find out how i can send, with php, a string message to a remote server:port

 

I want to make my server to respond via messages from a php page. Sever is made in .NET, is listening for incoming connections, analyzes the data, strings in my case, and responds accordingly.

 

I would appreciate if you could redirect me to some useful links.

 

Thank you in advance

 

 

Link to comment
Share on other sites

hello again,

 

thanks for the quick response, i was checking for the sockets that ive been advised but its not what i want to do.

 

Particularly i want 2 things, to accept some data from a web form and

 

1. add them in mysql.

2. send those data to remote machine in a specific port

 

i have stacked with the 2nd part.

 

Thanks for your time

Link to comment
Share on other sites

For an example of what you need to do go the the link I posted above. See the example called "Example 2285. Socket example: Simple TCP/IP client" on that page. This is sort of what you need to do. The request you send should obviously be changed to whatever your server (the one written with some sort of .NET technology) accepts.

Link to comment
Share on other sites

yes right..! Thanks a lot Daniel.

 

for the rest of people who look for something similar, we need a thread in order to be compliant with the tcp protocol, script has to keep the connection to reassure that messages have arrived to the destination.

 

I am not sure if we are in need of threads when we send msg via UTP packet. It would be great if somebody could answer.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.