Home Forums Support Packages not accepted/recognized

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3550
    Anonymous
    Inactive

    Hi there,

    i’m trying to develop a network application using networkcomms library. I implemented a few IncommingPackageHandler at the server side that work, but i’m stucking on the following server/client code:

    Server:

    public override void SetupConnection(){
    			logger.Debug ("Setting up Listeners for Worker {0}", connection);
    			connection.AppendIncomingPacketHandler<ShapeFilePartsRequest>("ShapeFilePartsRequest", ShapeFilePartsRequest);
    			connection.AppendIncomingPacketHandler<ShapeFilePartVectorsRequest>("ShapeFilePartVectorsRequest", ShapePartVectorsRequest);
    		}
    
    public void ShapeFilePartsRequest(PacketHeader header, Connection connection, ShapeFilePartsRequest request){
    			logger.Info("Client {0} requested information about parts in {1}",connection, request.Filename);
    			IFeatureSet fs = FeatureSet.Open(request.Filename);
    			ShapeFilePartsResponse resp = new ShapeFilePartsResponse ();
    			foreach (ShapeRange shape in fs.ShapeIndices)
    			{
    				resp.shapes.Add (new ShapeInfo (shape.FeatureType.ToString(), shape.StartIndex));
    			}
    			logger.Debug("Sending client {0} information about {1} shapes in {2}", connection, resp.shapes.Count, request.Filename);
    			connection.SendObject("ShapeFilePartsResponse", resp);
    			fs.Close ();
    		}

    Client:

    public List<ShapeInfo> requestShapeInfo(string filename){
    		ShapeFilePartsRequest shapesRequest = new ShapeFilePartsRequest();
    		shapesRequest.Filename = filename;
    
    		ShapeFilePartsResponse partsResponse = connection.SendReceiveObject<ShapeFilePartsRequest,ShapeFilePartsResponse>("ShapeFilePartsRequest", "ShapeFilePartsResponse" , 5000, shapesRequest);
    
    		Debug.Log ("received partsResponse with " + partsResponse.shapes.Count + " shape infos");
    		return partsResponse.shapes;
    	}

    The Server gets the request, does his things, and according to the logs, it sends a package of type “”ShapeFilePartsResponse”” back to the client, but the client doesn’t seem to receive his message, it gets a timeout. The other PackageHandler i wrote do have similar code and are working perfect.

    • This topic was modified 9 years, 9 months ago by .
    #3569
    Anonymous
    Inactive

    Heya Dennis,

    Thanks for your question. Unfortunately it is not possible to work out what may be going wrong using the information you have provided. My best recommendation is to implement logging and then investigate the logs for any particular error message. Please see https://networkcomms.net/enable-logging/ for more information.

    Kind regards,
    Marc

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.