Results 1 to 2 of 2

Thread: JAVA net aiuto pls

  1. #1
    Lieutenant Commander ahzael's Avatar
    Join Date
    Apr 2004
    Location
    Melbourne/Roma
    Posts
    7.270

    Default JAVA net aiuto pls

    mmm ho un problema, devo mandare un array o un vector da un server a un client, so mandare una stringa utilizzando il seguente codice

    OutputStream os=socket.getOutputStream();


    e poi utilizzando os.write("stringa random")

    come faccio nel caso che volessi mandare un array ?
    In diretta dalla terra dei canguri
    On WoW Daggerspine - soon Outland
    Ermucco Lev 60 Fury Warrior
    Ahzael Lev 70 Epic Druid
    **** OnDeira Albion ****
    Ahzael Skyscream RR7L1 Smiter No.1 di vorti
    E tutti gli Ahzael del mondo
    ************************
    Themaltake Soprano VX AMD 5000 2 gb Corsair
    Gigabyte GeForce 8600GT 512 , x2 250 WD
    Bachelor Computer Science, software engeneering @ Deakin University
    Honours of IT completed Thesis : "A novel IPTV system through mix P2P and Multicast system"


    Currently PhD
    Research "DDos attacks guard through multicore systems"
    "I PLAY" pd, magari avercelo il tempo per giocare :asd:

  2. #2
    Lieutenant Commander San Vegeta's Avatar
    Join Date
    Oct 2003
    Location
    Bologna
    Posts
    12.153

    Default

    non lo mandi. lo stream è una stringa di dati, se proprio vuoi fare il figo ti scrivi un protocollo per encodare l'array e il suo contenuto e usi lostesso protocollo per decodificarlo e ricostruire l'array su chi riceve.
    ma se devi spedire un oggetto array (o in generale degli oggetti), che in quanto tale contiene della logica, dovresti usare rmi, che permette di gestire variabili sia sui client che sul server.

    cambia completamente la gestione of course

    P.S. e io non sono laureato eh... porkozio
    I rubinetti a casa di Chuck Norris non perdono, vincono.

    In the beginning there was nothing...then Chuck Norris Roundhouse kicked that nothing in the face and said "Get a job". That is the story of the universe.

    Quote Originally Posted by Wolfo View Post
    Concordo e propongo ban temporanei per chi critica la topa , la topa non si critica , dal trombabile in su non si commenta in modo sgradevole.
    la tua ignoranza in materia e' raccapricciante
    -cit. Estrema, 2022

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[Output: 41.97 Kb. compressed to 35.65 Kb. by saving 6.32 Kb. (15.05%)]