× 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.



> This is what I have running:
>
> MakeListener  (which connects on port 9700)
>
> Dow 1 = 1
> Accept Connection (which creates a new socket on another port? say 1490)
> Talk to client (accept the data and send acknowlegement back)
> Close Socket (which was created in the accept connection  say 1490)
> Enddo

I'm going to re-word what you're saying above, saying it the way that I
understand it... that way, if I don't understand something, you can
correct me :)

1)  You call "MakeListener" which calls the socket() API to create a
      new socket (probably socket = 0 or socket = 3, we'll say 0)
      and you bind() socket 0 to port 9700, and then you tell it to
      listen() on that port.

2) Start of Infinite Loop.

3) You call accept() in blocking mode to wait for a new connection.
     When a client program connects, accept() creates a new socket,
     we'll call this socket 1.   The port that the client's messages
     are originating from may be port 1490, but also can be anything
     else they want to use.

4) Send & receive application data.

5) Close socket #1.

6) Go back to step 2 ( to continue infinite loop )


> The client says this works once. When they try to send another message
> (through port 9700), it fails. They tell me that their second message trys
> to come in on 1490 again, even tho I closed that one.

Maybe they weren't expecting you to close() the socket?   They're trying
to send another message, but you've "hung up the phone"?   Maybe they
were expecting you to wait for another message first?


> This makes no sense to me but what do I know. Being a beginner on
> sockets I want to make sure that this is what I should be doing.

Again... I can't answer this question.

> Is is possible that they are trying to send the second message through port
> 1490?

I would be very surprised if they're specifying a port.   They're probably
just calling socket(), then connect(), then send() and recv().  I strongly
doubt that they are specifying which port to use.

I think they're just calling send(), and it's returning an error because
you've already called close().

> I didn't think that they would even know about that one. What if the
> close didn't work correctly? Would their second messgage still be trying to
> come in through 1490?

I guess that's possible, if the close() didn't work, the iSeries would
either discard the packet, or it would send back an ICMP message
explaining that the connection had already closed.

But, that would mean that they're still trying to call send() to your
socket, even after the ACK.  Why would they do that if they knew you
were going to call close() after the ACK?!

It seems more likely to me that they're not expecting you to call close().


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.