× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



What is a socket?

A socket is a term used to describe one end of a TCP/IP connection.  When you 
create
a socket you can either have it wait for an incoming connection, or connect to 
some
remote system.  Lets take an outgoing socket.

We create the socket, and give it the IP address (or DNS name) of the remote 
system
we want to connect too, as well as a port number (FTP is 20 and 21 [might be 19 
and 20]),
HTTP is port 80, POP3 is port 110, etc... (Look for a file called 
C:\WINDOWS\SERVICES on your
PC and open it with any editor such as notepad, it will list many of the common 
ports).

Once we create this socket and give it the connection information, we tell it 
to connect.  It
will then go through the TCP/IP stack on the computer and attempt to open a 
connection with the
remote system.  If the remote system has it's own socket set up to listen on 
the port you are 
trying to connect to a session is establish.  At this point we have a TCP/IP 
connection between
the two machines. (TCP or UDP is another story)

Now, you can tell the socket to send data to the remote machine and have the 
socket listen for
incoming data from the remote machine.  What this data looks like is pretty 
much up to you.  It
can be anything you want to send and/or receive.  Normally this socket 
connection will remain
connected until one side or the other closes the socket (or we get a time out).

A socket is pretty much the lowest level you would program for TCP/IP on any 
machine.  On top
of sockets people make libraries (directories in AS/400 terms) of calls for 
different protocols.
In your program you might be writing to the HTTP library, but that all gets 
translated to sockets
anyway.

If you want to write a program to connect between two computers using TCP/IP, 
you need to learn
sockets.

I hope I've helped explain things.

Regards,

Jim Langston

"Barnes, Edward V. (RPW)" wrote:
> 
> Hi all,
>         I have a question on sockets. Where can I find information on
> sockets, This is the seconds time I have can across this function. What does
> it do? Talk to some people that have been programming for over five years
> and they could tell me what it does. Need information!
> Thanks
> Edward B.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.