Home Forums Support Packages not accepted/recognized

  • This topic has 1 reply, 2 voices, and was last updated 7 years ago by Anonymous.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #3550

    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:


    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 ();


    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 7 years, 1 month ago by .

    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,

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