[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird TCP/IP bug?



1I hacked a little server last night using the Release 7.2 version of
TCP/IP.  I was getting ready to pull my hair out, because I kept getting
the "Host Foo Bar refused a request for SERVICE:PORT<-PROTOCOL" or
something like that.  Here's what I did:

	1) I defined a server for the PROSE service, and loaded it on
           the "server" machine.

0(net:define-server :prose (:medium :byte-stream-with-mark :stream in :host host)
   (ignore-errors
     (tv:noting-progress ((format nil "PROSE serving ~A" host))
       (condition-case (err)
	    (prose-server in host)
	  (error
	    (if *notify-on-prose-server-error*
		(tv:notify nil "PROSE ended in error:~%~S" err)))))
     (force-output in)
     (close in)))

1	2) I defined a protocol for the PROSE service, and loaded it on
	   the "user" machine.  I named this protocol REMOTE-PROSE.

0(net:define-protocol :remote-prose (:prose :byte-stream-with-mark)
  (:invoke-with-stream-and-close
    (s &key (text "oops. I forgot my message"))
    (write-one-prose-phrase text s)))

1	3) I defined a TCP/IP port for this protocol (on both machines):

0(tcp:add-tcp-port-for-protocol :remote-prose 99)

1	4) I added a service entry in the host namespace object for the
	"server" machine:
0...
Service: PROSE TCP REMOTE-PROSE
....

1	5) I tried to invoke the PROSE service on the "user" machine:

0(neti:invoke-service-on-host :prose #h"kepler" :text "testing")

2Error: Request to KEPLER for a 278899(:PROSE) connection was refused.
       No reason was given.

TCP::CHECK-CONNECTION-STATE
0   Arg 0 (TCP::TCB): #<TCP connection to KEPLER 99 (:PROSE), local port 2788 12722723>
s-A, :    Periodically retry connection for TCP 99(:REMOTE-PROSE) to KEPLER until success
s-B:           Retry getting connection on INTERNET for PROSE (REMOTE-PROSE) -- KEPLER on INTERNET.
s-C:           Retry invoking PROSE (REMOTE-PROSE) -- KEPLER on INTERNET.
s-D:           Try PROSE (REMOTE-PROSE) -- KEPLER on INTERNET.
s-E:           Retry invoking PROSE on KEPLER.
s-F, :    Return to Lisp Top Level in Dynamic Lisp Listener 1
s-G:           Restart process Dynamic Lisp Listener 1


1	6) All services were enabled on the server machine.  I tried
	resetting the network, rebooting, and praying.  Nothing worked,
	until...

	I renamed the protocol to :PROSE so that it matched the server
	name.  I then changed the service entries and TCP port to use
	this new name.

0(net:define-protocol :prose (:prose :byte-stream-with-mark)
  (:invoke-with-stream-and-close
    (s &key (text "oops. I forgot my message"))
    (write-one-prose-phrase text s)))

1	7) Everything worked, without flaw.  Is this an undocumented
	feature?  What happens when I want to use multiple protocols
	with the same service?

Any tidbits of networking advice would be appreciated!

Cheers,
Scott