Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • stefan.goericke.gy/NetworkedGraphicsMV3500
  • william.mahan/NetworkedGraphicsMV3500
  • alexander.white/NetworkedGraphicsMV3500
  • kyle.britt/NetworkedGraphicsMV3500
  • christopher.garibay/NetworkedGraphicsMV3500
  • christopher.cannon/NetworkedGraphicsMV3500
  • galoeffe/NetworkedGraphicsMV3500
  • dlcain1/NetworkedGraphicsMV3500
  • jmfurr/NetworkedGraphicsMV3500
  • jrjackso1/NetworkedGraphicsMV3500
  • kjmaroon1/NetworkedGraphicsMV3500
  • cdtacket/NetworkedGraphicsMV3500
12 results
Show changes
Showing
with 1353 additions and 1090 deletions
# Start, ENCODING_PLAINTEXT, 20210814_173156, DIS capture file, pduLog\PduCaptureLog2.dislog
[0,0,0,0,0,0,0,0],[7,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,-16,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,65,108,108,80,100,117,83,101,110,100,101,0,0,0,0] # DisPduType 01 ENTITY_STATE
[0,0,0,0,1,93,-67,-104],[7,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 02 FIRE
[0,0,0,0,1,-7,8,72],[7,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 03 DETONATION
[0,0,0,0,2,50,81,32],[7,0,4,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 04 COLLISION
[0,0,0,0,2,93,-9,-68],[7,0,5,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 05 SERVICE_REQUEST
[0,0,0,0,2,122,-111,56],[7,0,6,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 06 RESUPPLY_OFFER
[0,0,0,0,2,-126,-99,96],[7,0,7,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 07 RESUPPLY_RECEIVED
[0,0,0,0,2,-120,45,-104],[7,0,8,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 08 RESUPPLY_CANCEL
[0,0,0,0,2,-117,-6,64],[7,0,9,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 09 REPAIR_COMPLETE
[0,0,0,0,2,-91,-90,-24],[7,0,10,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 10 REPAIR_RESPONSE
[0,0,0,0,2,-69,23,-108],[7,0,11,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 11 CREATE_ENTITY
[0,0,0,0,2,-54,-31,96],[7,0,12,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 12 REMOVE_ENTITY
[0,0,0,0,2,-49,27,104],[7,0,13,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 13 START_RESUME
[0,0,0,0,2,-32,-128,-120],[7,0,14,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 14 STOP_FREEZE
[0,0,0,0,2,-1,-93,-96],[7,0,15,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0] # DisPduType 15 ACKNOWLEDGE
[0,0,0,0,3,21,-126,116],[7,0,16,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 16 ACTION_REQUEST
[0,0,0,0,3,45,98,-12],[7,0,17,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 17 ACTION_RESPONSE
[0,0,0,0,3,65,92,60],[7,0,18,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 18 DATA_QUERY
[0,0,0,0,3,69,-60,-64],[7,0,19,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 19 SET_DATA
[0,0,0,0,3,75,25,52],[7,0,20,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 20 DATA
[0,0,0,0,3,80,68,64],[7,0,21,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 21 EVENT_REPORT
[0,0,0,0,3,94,-11,48],[7,0,22,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,-128,72,101,108,108,111,32,67,111,109,109,101,110,116,80,68,85,0,0,0,1,0,0,1,112,72,101,114,101,32,105,115,32,97,32,115,101,99,111,110,100,32,108,105,110,101,32,111,102,32,116,101,120,116,32,105,110,32,116,104,105,115,32,99,111,109,109,101,110,116,46,0,0] # DisPduType 22 COMMENT
[0,0,0,0,4,-11,8,-88],[7,0,23,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 23 ELECTROMAGNETIC_EMISSION
[0,0,0,0,5,6,70,84],[7,0,24,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 24 DESIGNATOR
[0,0,0,0,5,41,-124,52],[7,0,25,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 25 TRANSMITTER
[0,0,0,0,5,-60,-19,-64],[7,0,26,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0] # DisPduType 26 SIGNAL
[0,0,0,0,5,-15,-53,-80],[7,0,27,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 27 RECEIVER
[0,0,0,0,6,11,-15,-44],[7,0,28,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 28 IDENTIFICATION_FRIEND_OR_FOE
[0,0,0,0,6,107,-107,8],[7,0,29,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 29 UNDERWATER_ACOUSTIC
[0,0,0,0,6,-121,-10,68],[7,0,30,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 30 SUPPLEMENTAL_EMISSION_ENTITY_STATE
[0,0,0,0,6,-115,42,-80],[7,0,31,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0] # DisPduType 31 INTERCOM_SIGNAL
[0,0,0,0,6,-100,-47,-72],[7,0,32,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 32 INTERCOM_CONTROL
[0,0,0,0,6,-66,61,-8],[7,0,33,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 33 AGGREGATE_STATE
[0,0,0,0,7,25,44,24],[7,0,34,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 34 ISGROUPOF
[0,0,0,0,7,48,77,-108],[7,0,35,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 35 TRANSFER_OWNERSHIP
[0,0,0,0,7,92,46,0],[7,0,36,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 36 ISPARTOF
[0,0,0,0,7,-104,99,72],[7,0,37,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 37 MINEFIELD_STATE
[0,0,0,0,7,-6,51,-24],[7,0,38,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 38 MINEFIELD_QUERY
[0,0,0,0,8,10,73,124],[7,0,39,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 39 MINEFIELD_DATA
[0,0,0,0,8,24,-90,112],[7,0,40,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 40 MINEFIELD_RESPONSE_NACK
[0,0,0,0,8,29,73,-16],[7,0,41,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 41 ENVIRONMENTAL_PROCESS
[0,0,0,0,8,66,73,-48],[7,0,42,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 42 GRIDDED_DATA
[0,0,0,0,8,92,94,-60],[7,0,43,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 43 POINT_OBJECT_STATE
[0,0,0,0,8,-59,113,-4],[7,0,44,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 44 LINEAR_OBJECT_STATE
[0,0,0,0,8,-50,117,-52],[7,0,45,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 45 AREAL_OBJECT_STATE
[0,0,0,0,8,-20,39,-64],[7,0,46,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 46 TIME_SPACE_POSITION_INFORMATION
[0,0,0,0,9,100,-111,36],[7,0,47,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 47 APPEARANCE
[0,0,0,0,9,119,65,32],[7,0,48,11,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 48 ARTICULATED_PARTS
[0,0,0,0,9,126,87,-8],[7,0,49,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 49 LIVE_ENTITY_FIRE
[0,0,0,0,9,-122,82,-16],[7,0,50,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 50 LIVE_ENTITY_DETONATION
[0,0,0,0,9,-86,-64,-72],[7,0,51,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 51 CREATE_ENTITY_RELIABLE
[0,0,0,0,9,-76,-125,-116],[7,0,52,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 52 REMOVE_ENTITY_RELIABLE
[0,0,0,0,9,-68,-60,112],[7,0,53,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 53 START_RESUME_RELIABLE
[0,0,0,0,9,-61,79,12],[7,0,54,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 54 STOP_FREEZE_RELIABLE
[0,0,0,0,9,-50,98,-4],[7,0,55,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0] # DisPduType 55 ACKNOWLEDGE_RELIABLE
[0,0,0,0,9,-42,124,-48],[7,0,56,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 56 ACTION_REQUEST_RELIABLE
[0,0,0,0,9,-31,42,104],[7,0,57,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 57 ACTION_RESPONSE_RELIABLE
[0,0,0,0,9,-21,-95,-76],[7,0,58,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 58 DATA_QUERY_RELIABLE
[0,0,0,0,9,-6,62,-72],[7,0,59,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 59 SET_DATA_RELIABLE
[0,0,0,0,10,2,74,-32],[7,0,60,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 60 DATA_RELIABLE
[0,0,0,0,10,12,-88,0],[7,0,61,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 61 EVENT_REPORT_RELIABLE
[0,0,0,0,10,22,-105,92],[7,0,62,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 62 COMMENT_RELIABLE
[0,0,0,0,10,26,-6,-52],[7,0,63,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 63 RECORD_RELIABLE
[0,0,0,0,10,54,-76,-40],[7,0,64,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 64 SET_RECORD_RELIABLE
[0,0,0,0,10,62,73,120],[7,0,65,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 65 RECORD_QUERY_RELIABLE
[0,0,0,0,10,81,92,-84],[7,0,66,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 66 COLLISION_ELASTIC
[0,0,0,0,10,87,-28,-116],[7,0,67,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 67 ENTITY_STATE_UPDATE
[0,0,0,0,10,93,64,8],[7,0,68,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 68 DIRECTED_ENERGY_FIRE
[0,0,0,0,10,-118,-59,40],[7,0,69,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 69 ENTITY_DAMAGE_STATUS
[0,0,0,0,10,-113,-122,-68],[7,0,70,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 70 INFORMATION_OPERATIONS_ACTION
[0,0,0,0,12,120,-36,-88],[7,0,71,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # DisPduType 71 INFORMATION_OPERATIONS_REPORT
[0,0,0,0,12,-114,53,-28],[7,0,72,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0] # DisPduType 72 ATTRIBUTE
# Finish, ENCODING_PLAINTEXT, 20210814_173309, DIS capture file, pduLog\PduCaptureLog2.dislog
# PDU Log Files
This directory holds temporary PDU log files which may be deleted at any time!
To clean out old log files, simply run this project's **[../build.xml](../build.xml)** target `clean.all.pduLogs`
Each time you run a DIS simulation and a PduRecorder is listening, another
log file is created. File names are numbered sequentially and uniquely, so that
important PDU log captures can later be copied and saved to where they are needed.
[ExamplePduCaptureLog.dislog](ExamplePduCaptureLog.dislog) shows an example log file.
Be sure to save your work, when appropriate, by copying log files of interest to
the corresponding homework or project directory (and likely renaming as well).
Note that the PDU log files are very tolerant of inline comments starting with
a # character, so you can document success/failure and TODO issues there as well.
<!-- https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/assignments/pduLog/README.md -->
## Student assignments: homework submission directories
* [Homework 1 README](homework1/README.md)
* [Homework 2 README](homework2/README.md)
* [Homework 3 README](homework3/README.md)
* [Homework 4 README](homework4/README.md)
Please see the [README.md](../../../README.md) in the parent
[assignments](../../../../assignments) directory for detailed instructions.
\ No newline at end of file
package MV3500Cohort2018JanuaryMarch.homework1;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// no package required or desired, use Netbeans menu item "Run File
import java.io.*;
import java.net.*;
/**
*
* @author cs2017
*/
public class AngelClient {
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
boolean operate = true;
while (operate)
{
try
{
System.out.println("creating socket");
// We request an IP to connect to ("localhost") and
// port number at that IP (2317). This establishes
// a connection to that IP in the form of the Socket
// object; the server uses a ServerSocket to wait for
// connections.
Socket socket = new Socket("localhost", 2317);
// Read the single line written by the server. We'd
// do things a bit differently if many lines to be read
// from the server, instead of one only.
InputStream is = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String serverMessage = br.readLine();
if ("Exit".equals(serverMessage)){
System.out.println("The server has asked to shut the client down.");
operate = false;
}
else {
int spd = Integer.parseInt(br.readLine());
int x = Integer.parseInt(br.readLine());
int y = Integer.parseInt(br.readLine());
int z = Integer.parseInt(br.readLine());
String lastCommand = br.readLine();
AngelTank tank = new AngelTank(serverMessage, spd, new int[]{x, y, z});
System.out.println(serverMessage+" is traveling at "+spd+" with position ("+x+", "+y+", "+z+").");
if ("Exit".equals(lastCommand)){
System.out.println("The server has asked to shut the client down.");
operate = false;
}
}
}
catch(IOException e)
{
System.out.println(e);
System.out.println("Problem with client");
}
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// no package required or desired, use Netbeans menu item "Run File
import java.io.*;
import java.net.*;
/**
* homework assignment
* @author cs2017
*/
public class AngelClient
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public AngelClient ()
{
// default initializations occur here
}
/**
* Program invocation, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
boolean operate = true;
while (operate)
{
try
{
System.out.println("creating socket");
// We request an IP to connect to ("localhost") and
// port number at that IP (2317). This establishes
// a connection to that IP in the form of the Socket
// object; the server uses a ServerSocket to wait for
// connections.
Socket socket = new Socket("localhost", 2317);
// Read the single line written by the server. We'd
// do things a bit differently if many lines to be read
// from the server, instead of one only.
InputStream is = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String serverMessage = br.readLine();
if ("Exit".equals(serverMessage)){
System.out.println("The server has asked to shut the client down.");
operate = false;
}
else {
int spd = Integer.parseInt(br.readLine());
int x = Integer.parseInt(br.readLine());
int y = Integer.parseInt(br.readLine());
int z = Integer.parseInt(br.readLine());
String lastCommand = br.readLine();
AngelTank tank = new AngelTank(serverMessage, spd, new int[]{x, y, z});
System.out.println(serverMessage+" is traveling at "+spd+" with position ("+x+", "+y+", "+z+").");
if ("Exit".equals(lastCommand)){
System.out.println("The server has asked to shut the client down.");
operate = false;
}
}
}
catch(IOException e)
{
System.out.println(e);
System.out.println("Problem with client");
}
}
}
}
package MV3500Cohort2018JanuaryMarch.homework1;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// no package required or desired, use Netbeans menu item "Run File"
import java.io.*;
import java.net.*;
/**
*
* @author cs2017
*/
public class AngelServer {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
boolean goforit = true;
try
{
// ServerSocket waits for a connection from a client.
// Notice that it is outside the loop; ServerSocket
// needs to be made only once.
ServerSocket serverSocket = new ServerSocket(2317);
// Loop, infinitely, waiting for client connections.
// Stop the program somewhere else.
while(goforit)
{
Socket clientConnection = serverSocket.accept();
OutputStream os = clientConnection.getOutputStream();
PrintStream ps = new PrintStream(os);
// Print some information locally about the Socket
// connection. This includes the port and IP numbers
// on both sides (the socket pair.)
InetAddress localAddress = clientConnection.getLocalAddress();
InetAddress remoteAddress = clientConnection.getInetAddress();
int localPort = clientConnection.getLocalPort();
int remotePort = clientConnection.getPort();
// My socket pair connection looks like this, to localhost:
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54876 ))
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54881 ))
//
// Why is the first IP/port the same, while the second set has
// different ports?
System.out.println("Socket pair: (( " + localAddress.toString() + ", " + localPort + " ), ( " +
remoteAddress.toString() + ", " + remotePort + " ))");
// Notice the use of flush() and close(). Without
// the close() to Socket object may stay open for
// a while after the client has stopped needing this
// connection. Close() explicitly ends the connection.
ps.println("Abrams 1");
ps.println(60);
ps.println(152);
ps.println(25);
ps.println(30);
ps.println("Exit");
ps.flush();
clientConnection.close();
}
}
catch(Exception e)
{
System.out.println("problem with networking");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// no package required or desired, use Netbeans menu item "Run File"
import java.io.*;
import java.net.*;
/**
* homework assignment
* @author cs2017
*/
public class AngelServer
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public AngelServer ()
{
// default initializations occur here
}
/**
* Program invocation, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
boolean goforit = true;
try
{
// ServerSocket waits for a connection from a client.
// Notice that it is outside the loop; ServerSocket
// needs to be made only once.
ServerSocket serverSocket = new ServerSocket(2317);
// Loop, infinitely, waiting for client connections.
// Stop the program somewhere else.
while(goforit)
{
Socket clientConnection = serverSocket.accept();
OutputStream os = clientConnection.getOutputStream();
PrintStream ps = new PrintStream(os);
// Print some information locally about the Socket
// connection. This includes the port and IP numbers
// on both sides (the socket pair.)
InetAddress localAddress = clientConnection.getLocalAddress();
InetAddress remoteAddress = clientConnection.getInetAddress();
int localPort = clientConnection.getLocalPort();
int remotePort = clientConnection.getPort();
// My socket pair connection looks like this, to localhost:
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54876 ))
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54881 ))
//
// Why is the first IP/port the same, while the second set has
// different ports?
System.out.println("Socket pair: (( " + localAddress.toString() + ", " + localPort + " ), ( " +
remoteAddress.toString() + ", " + remotePort + " ))");
// Notice the use of flush() and close(). Without
// the close() to Socket object may stay open for
// a while after the client has stopped needing this
// connection. Close() explicitly ends the connection.
ps.println("Abrams 1");
ps.println(60);
ps.println(152);
ps.println(25);
ps.println(30);
ps.println("Exit");
ps.flush();
clientConnection.close();
}
}
catch(Exception e)
{
System.out.println("problem with networking");
}
}
}
\ No newline at end of file
package MV3500Cohort2018JanuaryMarch.homework1;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// no package required or desired, Netbeans will automatically compile
/**
*
* @author cs2017
*/
public class AngelTank {
private String type;
private int speed;
private int[] position;
AngelTank(String type, int i, int[] pos) {
this.type = type;
this.speed = i;
this.position = pos;
}
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @return the speed
*/
public int getSpeed() {
return speed;
}
/**
* @return the position
*/
public int[] getPosition() {
return position;
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// no package required or desired, Netbeans will automatically compile
/**
* homework assignment
* @author cs2017
*/
public class AngelTank {
private String type;
private int speed;
private int[] position;
AngelTank(String type, int i, int[] pos) {
this.type = type;
this.speed = i;
this.position = pos;
}
/**
* get current type
* @return the type
*/
public String getType() {
return type;
}
/**
* get current speed
* @return the speed
*/
public int getSpeed() {
return speed;
}
/**
* get current position
* @return the position
*/
public int[] getPosition() {
return position;
}
}
package MV3500Cohort2018JanuaryMarch.homework1;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//package mv3500code;
import java.io.*;
import java.net.*;
/**
* Before, we always used telnet to connect to the server. We
* are now writing our own program to do the connection.
*
* As you will see, when we run this after we start the server
* we will see the same string telnet printed, sent by the server.
* The output at the server will show different socket pairs for
* each time we ran it.
*
* @author mcgredo
*/
public class BlankenbekerMyTcpClient {
public static void main(String[] args)
{
try
{
while(true){
System.out.println("creating socket");
// We request an IP to connect to ("localhost") and
// port number at that IP (2317). This establishes
// a connection to that IP in the form of the Socket
// object; the server uses a ServerSocket to wait for
// connections.
Socket socket = new Socket("localhost", 2317);
// Read the single line written by the server. We'd
// do things a bit differently if many lines to be read
// from the server, instead of one only.
InputStream is = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String serverMessage = br.readLine();
System.out.println("The message the server sent was " + serverMessage);
OutputStream os = socket.getOutputStream();
PrintStream ps = new PrintStream(os);
ps.println("This response was written by myTcpClient"); // to remote client
// "flush()" in important in that it forces a write
// across what is in fact a slow connection
ps.flush();
}
}
catch(IOException e)
{
System.out.println(e);
System.out.println("Problem with client :" + e);
}
System.out.println("client exit");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//package mv3500code;
import java.io.*;
import java.net.*;
/**
* Before, we always used telnet to connect to the server. We
* are now writing our own program to do the connection.
*
* As you will see, when we run this after we start the server
* we will see the same string telnet printed, sent by the server.
* The output at the server will show different socket pairs for
* each time we ran it.
*
* @author mcgredo
*/
public class BlankenbekerMyTcpClient
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public BlankenbekerMyTcpClient ()
{
// default initializations occur here
}
/**
* Program invocation, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
try
{
while(true){
System.out.println("creating socket");
// We request an IP to connect to ("localhost") and
// port number at that IP (2317). This establishes
// a connection to that IP in the form of the Socket
// object; the server uses a ServerSocket to wait for
// connections.
Socket socket = new Socket("localhost", 2317);
// Read the single line written by the server. We'd
// do things a bit differently if many lines to be read
// from the server, instead of one only.
InputStream is = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String serverMessage = br.readLine();
System.out.println("The message the server sent was " + serverMessage);
OutputStream os = socket.getOutputStream();
PrintStream ps = new PrintStream(os);
ps.println("This response was written by myTcpClient"); // to remote client
// "flush()" in important in that it forces a write
// across what is in fact a slow connection
ps.flush();
}
}
catch(IOException e)
{
System.out.println(e);
System.out.println("Problem with client :" + e);
}
System.out.println("client exit");
}
}
package MV3500Cohort2018JanuaryMarch.homework1;
//package mv3500code;
import java.io.*;
import java.net.*;
/**
* Very slightly more complex than example1. A complete copy of
* example 2. The only thing this does
* differently is introduce a loop into the response, so you don't
* have to restart the program after one response. Also, it prints
* out the socket pair the server sees. Run the program via telnet
* several times and compare the socket pairs.
*
* telnet localhost 2317
*
* If you're sophisticated you can contact the instructor's computer
* while running this program.
*
* telnet <ipOfServersLaptop> 2317
*
* And have him display the socket pairs he got.
* @author mcgredo
*/
public class BlankenbekerMyTcpServer
{
public static void main(String[] args)
{
try
{
// ServerSocket waits for a connection from a client.
// Notice that it is outside the loop; ServerSocket
// needs to be made only once.
int connectionCount = 0;
ServerSocket serverSocket = new ServerSocket(2317);
Socket clientConnection = serverSocket.accept();
// Loop, infinitely, waiting for client connections.
// Stop the program somewhere else.
while(true)
{
OutputStream os = clientConnection.getOutputStream();
PrintStream ps = new PrintStream(os);
connectionCount++;
ps.println("This was written by the server");
InputStream is = clientConnection.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String serverMessage = br.readLine();
System.out.println("The message the client sent was " + serverMessage);
// Print some information locally about the Socket
// connection. This includes the port and IP numbers
// on both sides (the socket pair.)
InetAddress localAddress = clientConnection.getLocalAddress();
InetAddress remoteAddress = clientConnection.getInetAddress();
int localPort = clientConnection.getLocalPort();
int remotePort = clientConnection.getPort();
// My socket pair connection looks like this, to localhost:
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54876 ))
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54881 ))
//
// Why is the first IP/port the same, while the second set has
// different ports?
System.out.println("Socket pair: (( " + localAddress.toString() + ", " + localPort + " ), ( " +
remoteAddress.toString() + ", " + remotePort + " ))");
System.out.println("Connection count is: " + connectionCount);
// Notice the use of flush() and close(). Without
// the close() to Socket object may stay open for
// a while after the client has stopped needing this
// connection. Close() explicitly ends the connection.
ps.flush();
clientConnection.close();
}
}
catch(Exception e)
{
System.out.println("problem with networking");
}
}
}
//package mv3500code;
import java.io.*;
import java.net.*;
/**
* Very slightly more complex than example1. A complete copy of
* example 2. The only thing this does
* differently is introduce a loop into the response, so you don't
* have to restart the program after one response. Also, it prints
* out the socket pair the server sees. Run the program via telnet
* several times and compare the socket pairs.
*
* telnet localhost 2317
*
* If you're sophisticated you can contact the instructor's computer
* while running this program.
*
* telnet [ipAddressOfServerLaptop] 2317
*
* And have him display the socket pairs he got.
* @author mcgredo
*/
public class BlankenbekerMyTcpServer
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public BlankenbekerMyTcpServer ()
{
// default initializations occur here
}
/** run the program
* @param args command-line arguments, string parameters (unused) */
public static void main(String[] args)
{
try
{
// ServerSocket waits for a connection from a client.
// Notice that it is outside the loop; ServerSocket
// needs to be made only once.
int connectionCount = 0;
ServerSocket serverSocket = new ServerSocket(2317);
Socket clientConnection = serverSocket.accept();
// Loop, infinitely, waiting for client connections.
// Stop the program somewhere else.
while(true)
{
OutputStream os = clientConnection.getOutputStream();
PrintStream ps = new PrintStream(os);
connectionCount++;
ps.println("This was written by the server");
InputStream is = clientConnection.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String serverMessage = br.readLine();
System.out.println("The message the client sent was " + serverMessage);
// Print some information locally about the Socket
// connection. This includes the port and IP numbers
// on both sides (the socket pair.)
InetAddress localAddress = clientConnection.getLocalAddress();
InetAddress remoteAddress = clientConnection.getInetAddress();
int localPort = clientConnection.getLocalPort();
int remotePort = clientConnection.getPort();
// My socket pair connection looks like this, to localhost:
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54876 ))
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54881 ))
//
// Why is the first IP/port the same, while the second set has
// different ports?
System.out.println("Socket pair: (( " + localAddress.toString() + ", " + localPort + " ), ( " +
remoteAddress.toString() + ", " + remotePort + " ))");
System.out.println("Connection count is: " + connectionCount);
// Notice the use of flush() and close(). Without
// the close() to Socket object may stay open for
// a while after the client has stopped needing this
// connection. Close() explicitly ends the connection.
ps.flush();
clientConnection.close();
}
}
catch(Exception e)
{
System.out.println("problem with networking");
}
}
}
package MV3500Cohort2018JanuaryMarch.homework1;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//package Homework1;
import java.io.*;
import java.net.*;
/**
*
* @author Brian
*/
public class HanleyTcpClient {
public static void main(String[] args)
{
try
{
System.out.println("creating socket");
// We request an IP to connect to ("localhost") and
// port number at that IP (2317). This establishes
// a connection to that IP in the form of the Socket
// object; the server uses a ServerSocket to wait for
// connections.
Socket socket = new Socket("localhost", 2317);
// Read the single line written by the server. We'd
// do things a bit differently if many lines to be read
// from the server, instead of one only.
InputStream is = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String serverMessage = br.readLine();
System.out.println("1 The message the server sent was " + serverMessage);
// Outgoing Messages
OutputStream os = socket.getOutputStream();
PrintStream ps = new PrintStream(os);
ps.println("bbb report: X, Y, X " + System.currentTimeMillis());
serverMessage = br.readLine();
System.out.println("2 The message the server sent was " + serverMessage);
//os = socket.getOutputStream();
// ps = new PrintStream(os);
ps.println("Final message from client " + System.currentTimeMillis());
serverMessage = br.readLine();
System.out.println("3 The message the server sent was " + serverMessage);
}
catch(Exception e)
{
System.out.println(e);
System.out.println("Problem with client");
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//package Homework1;
import java.io.*;
import java.net.*;
/**
* homework assignment
* @author Brian
*/
public class HanleyTcpClient
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public HanleyTcpClient ()
{
// default initializations occur here
}
/** run the program
* @param args command-line arguments, string parameters (unused) */
public static void main(String[] args)
{
try
{
System.out.println("creating socket");
// We request an IP to connect to ("localhost") and
// port number at that IP (2317). This establishes
// a connection to that IP in the form of the Socket
// object; the server uses a ServerSocket to wait for
// connections.
Socket socket = new Socket("localhost", 2317);
// Read the single line written by the server. We'd
// do things a bit differently if many lines to be read
// from the server, instead of one only.
InputStream is = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String serverMessage = br.readLine();
System.out.println("1 The message the server sent was " + serverMessage);
// Outgoing Messages
OutputStream os = socket.getOutputStream();
PrintStream ps = new PrintStream(os);
ps.println("bbb report: X, Y, X " + System.currentTimeMillis());
serverMessage = br.readLine();
System.out.println("2 The message the server sent was " + serverMessage);
//os = socket.getOutputStream();
// ps = new PrintStream(os);
ps.println("Final message from client " + System.currentTimeMillis());
serverMessage = br.readLine();
System.out.println("3 The message the server sent was " + serverMessage);
}
catch(Exception e)
{
System.out.println(e);
System.out.println("Problem with client");
}
}
}
package MV3500Cohort2018JanuaryMarch.homework1;
//package Homework1;
import java.io.*;
import java.net.*;
/**
*
* @author Brian
*/
public class HanleyTcpServer {
/**
* Very slightly more complex than example1. A complete copy of
* example 2. The only thing this does
* differently is introduce a loop into the response, so you don't
* have to restart the program after one response. Also, it prints
* out the socket pair the server sees. Run the program via telnet
* several times and compare the socket pairs.
*
* telnet localhost 2317
*
* If you're sophisticated you can contact the instructor's computer
* while running this program.
*
* telnet <ipOfServersLaptop> 2317
*
* And have him display the socket pairs he got.
* @author mcgredo
*/
public static void main(String[] args)
{
try
{
// ServerSocket waits for a connection from a client.
// Notice that it is outside the loop; ServerSocket
// needs to be made only once.
ServerSocket serverSocket = new ServerSocket(2317);
Socket clientConnection = serverSocket.accept();
// Loop, infinitely, waiting for client connections.
// Stop the program somewhere else.
while(true)
{
//Socket clientConnection = serverSocket.accept();
OutputStream os = clientConnection.getOutputStream();
PrintStream ps = new PrintStream(os);
ps.println("This was written by the server");
// Print some information locally about the Socket
// connection. This includes the port and IP numbers
// on both sides (the socket pair.)
InetAddress localAddress = clientConnection.getLocalAddress();
InetAddress remoteAddress = clientConnection.getInetAddress();
int localPort = clientConnection.getLocalPort();
int remotePort = clientConnection.getPort();
// My socket pair connection looks like this, to localhost:
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54876 ))
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54881 ))
//
// Why is the first IP/port the same, while the second set has
// different ports?
System.out.println("Socket pair: (( " + localAddress.toString() + ", " + localPort + " ), ( " +
remoteAddress.toString() + ", " + remotePort + " ))");
//Exchange of Data
InputStream is = clientConnection.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String clientMessage = br.readLine();
if (clientMessage.startsWith("loc")){
System.out.println("Location Report \n"+ clientMessage);
}
else System.out.println("Incoming Message \n" + clientMessage);
ps.println("Message received");
// Notice the use of flush() and close(). Without
// the close() to Socket object may stay open for
// a while after the client has stopped needing this
// connection. Close() explicitly ends the connection.
ps.flush();
clientConnection.close();
}
}
catch(Exception e)
{
System.out.println("problem with networking");
}
}
}
//package Homework1;
import java.io.*;
import java.net.*;
/**
* Very slightly more complex than example1. A complete copy of
* example 2. The only thing this does
* differently is introduce a loop into the response, so you don't
* have to restart the program after one response. Also, it prints
* out the socket pair the server sees. Run the program via telnet
* several times and compare the socket pairs.
*
* telnet localhost 2317
*
* If you're sophisticated you can contact the instructor's computer
* while running this program.
*
* telnet [ipAddressOfServerLaptop] 2317
*
* And have him display the socket pairs he got.
* @author Brian
*/
public class HanleyTcpServer
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public HanleyTcpServer ()
{
// default initializations occur here
}
/**
* Program invocation, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
try
{
// ServerSocket waits for a connection from a client.
// Notice that it is outside the loop; ServerSocket
// needs to be made only once.
ServerSocket serverSocket = new ServerSocket(2317);
Socket clientConnection = serverSocket.accept();
// Loop, infinitely, waiting for client connections.
// Stop the program somewhere else.
while(true)
{
//Socket clientConnection = serverSocket.accept();
OutputStream os = clientConnection.getOutputStream();
PrintStream ps = new PrintStream(os);
ps.println("This was written by the server");
// Print some information locally about the Socket
// connection. This includes the port and IP numbers
// on both sides (the socket pair.)
InetAddress localAddress = clientConnection.getLocalAddress();
InetAddress remoteAddress = clientConnection.getInetAddress();
int localPort = clientConnection.getLocalPort();
int remotePort = clientConnection.getPort();
// My socket pair connection looks like this, to localhost:
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54876 ))
// Socket pair: (( /0:0:0:0:0:0:0:1, 2317 ), ( /0:0:0:0:0:0:0:1, 54881 ))
//
// Why is the first IP/port the same, while the second set has
// different ports?
System.out.println("Socket pair: (( " + localAddress.toString() + ", " + localPort + " ), ( " +
remoteAddress.toString() + ", " + remotePort + " ))");
//Exchange of Data
InputStream is = clientConnection.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String clientMessage = br.readLine();
if (clientMessage.startsWith("loc")){
System.out.println("Location Report \n"+ clientMessage);
}
else System.out.println("Incoming Message \n" + clientMessage);
ps.println("Message received");
// Notice the use of flush() and close(). Without
// the close() to Socket object may stay open for
// a while after the client has stopped needing this
// connection. Close() explicitly ends the connection.
ps.flush();
clientConnection.close();
}
}
catch(Exception e)
{
System.out.println("problem with networking");
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package MV3500Cohort2018JanuaryMarch.homework1;
import java.io.*;
import java.net.*;
/**
*
* @author Rico
*/
public class LandasClient1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try
{
System.out.println("Creating Socket");
Socket cs = new Socket("localhost", 2317);
while (true) {
PrintStream cp = new PrintStream(cs.getOutputStream());
System.out.print("\nClient: \n");
System.out.print("Please enter entity identifier and position: ");
InputStreamReader cir = new InputStreamReader(System.in);
BufferedReader cbr = new BufferedReader(cir);
String temp1 = cbr.readLine();
cp.println(temp1);
BufferedReader cbr1 = new BufferedReader(new InputStreamReader(cs.getInputStream()));
String temp2 = cbr1.readLine();
System.out.print(temp2);
}
}
catch(Exception e)
{
System.out.println(e);
System.out.println(" Problem with client");
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package MV3500Cohort2018JanuaryMarch.homework1;
import java.io.*;
import java.net.*;
/**
* homework assignment
* @author Rico
*/
public class LandasClient1
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public LandasClient1 ()
{
// default initializations occur here
}
/**
* Program invocation, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args) {
try
{
System.out.println("Creating Socket");
Socket cs = new Socket("localhost", 2317);
while (true) {
PrintStream cp = new PrintStream(cs.getOutputStream());
System.out.print("\nClient: \n");
System.out.print("Please enter entity identifier and position: ");
InputStreamReader cir = new InputStreamReader(System.in);
BufferedReader cbr = new BufferedReader(cir);
String temp1 = cbr.readLine();
cp.println(temp1);
BufferedReader cbr1 = new BufferedReader(new InputStreamReader(cs.getInputStream()));
String temp2 = cbr1.readLine();
System.out.print(temp2);
}
}
catch(Exception e)
{
System.out.println(e);
System.out.println(" Problem with client");
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package MV3500Cohort2018JanuaryMarch.homework1;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.util.Scanner;
/**
*
* @author Rico
*/
public class LandasClient2 {
public static DataInputStream in;
public static DataOutputStream out;
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
//declare a scanner so we can write a message
Scanner keyboard = new Scanner(System.in);
// localhost ip
String ip = "127.0.0.1";
int port = 2317;
Socket socket;
try {
//connect
socket = new Socket(ip, port);
//initialize streams
//DataInputStream in = new DataInputStream(socket.getInputStream());
//DataOutputStream out = new DataOutputStream(socket.getOutputStream());
in = new DataInputStream(socket.getInputStream());
out = new DataOutputStream(socket.getOutputStream());
while (true){
System.out.print("\nMessage to server: ");
//Write a message
String message = keyboard.nextLine();
//Send it to the server which will print it and send a confirmation
out.writeUTF(message);
// recieve the incoming messages and print
String message2 = in.readUTF();
System.out.println(message2);
}
}
catch(IOException e) {
System.out.println(e);
System.out.println("\nProblem with client");
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package MV3500Cohort2018JanuaryMarch.homework1;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.util.Scanner;
/**
* homework assignment
* @author Rico
*/
public class LandasClient2
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public LandasClient2 ()
{
// default initializations
}
static DataInputStream in;
static DataOutputStream out;
/**
* Program invocation, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
//declare a scanner so we can write a message
Scanner keyboard = new Scanner(System.in);
// localhost ip
String ip = "127.0.0.1";
int port = 2317;
Socket socket;
try {
//connect
socket = new Socket(ip, port);
//initialize streams
//DataInputStream in = new DataInputStream(socket.getInputStream());
//DataOutputStream out = new DataOutputStream(socket.getOutputStream());
in = new DataInputStream(socket.getInputStream());
out = new DataOutputStream(socket.getOutputStream());
while (true){
System.out.print("\nMessage to server: ");
//Write a message
String message = keyboard.nextLine();
//Send it to the server which will print it and send a confirmation
out.writeUTF(message);
// recieve the incoming messages and print
String message2 = in.readUTF();
System.out.println(message2);
}
}
catch(IOException e) {
System.out.println(e);
System.out.println("\nProblem with client");
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package MV3500Cohort2018JanuaryMarch.homework1;
import java.io.*;
import java.net.*;
/**
*
* @author Rico
*/
public class LandasServer1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try
{
ServerSocket ss = new ServerSocket(2317);
while(true) {
Socket cs = ss.accept();
BufferedReader cbr = new BufferedReader(new InputStreamReader(cs.getInputStream()));
String temp = cbr.readLine();
//System.out.println("Client:" + temp);
//JOptionPane.showMessageDialog(null,"Salam");
PrintStream spr = new PrintStream(cs.getOutputStream());
String temp1 = "Server: I got your message: " + temp;
spr.println(temp1);
//server();
}
}
catch(Exception e) {
System.out.println("problem with networking");
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package MV3500Cohort2018JanuaryMarch.homework1;
import java.io.*;
import java.net.*;
/**
* homework assignment
* @author Rico
*/
public class LandasServer1
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public LandasServer1 ()
{
// default initializations occur here
}
/**
* Program invocation, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args) {
try
{
ServerSocket ss = new ServerSocket(2317);
while(true) {
Socket cs = ss.accept();
BufferedReader cbr = new BufferedReader(new InputStreamReader(cs.getInputStream()));
String temp = cbr.readLine();
//System.out.println("Client:" + temp);
//JOptionPane.showMessageDialog(null,"Salam");
PrintStream spr = new PrintStream(cs.getOutputStream());
String temp1 = "Server: I got your message: " + temp;
spr.println(temp1);
//server();
}
}
catch(Exception e) {
System.out.println("problem with networking");
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package MV3500Cohort2018JanuaryMarch.homework1;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
/**
*
* @author Rico
*/
public class LandasServer2 {
public static DataInputStream in;
public static DataOutputStream out;
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int port = 2317;
ServerSocket server;
Socket clientSocket;
try {
//start listening on port
server = new ServerSocket(port);
System.out.println("Listening on port: " + port);
//Accept client
clientSocket = server.accept();
System.out.println("Client Connected!");
//initialize streams so we can send message
in = new DataInputStream(clientSocket.getInputStream());
out = new DataOutputStream(clientSocket.getOutputStream());
String message;
while (true) {
// as soon as a message is being received, print it out!
message = in.readUTF();
System.out.println("Server received: " + message);
// send a message confirmation to the client
String temp1 = "Server: I received your message of " + "'" + message + "'";
out.writeUTF(temp1);
}
}
catch(IOException e) {
System.out.println("problem with networking: " + e);
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package MV3500Cohort2018JanuaryMarch.homework1;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
/**
* homework assignment
* @author Rico
*/
public class LandasServer2
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public LandasServer2 ()
{
// default initializations occur here
}
static DataInputStream in;
static DataOutputStream out;
/** run the program
* @param args command-line arguments, string parameters (unused) */
public static void main(String[] args) {
// TODO code application logic here
int port = 2317;
ServerSocket server;
Socket clientSocket;
try {
//start listening on port
server = new ServerSocket(port);
System.out.println("Listening on port: " + port);
//Accept client
clientSocket = server.accept();
System.out.println("Client Connected!");
//initialize streams so we can send message
in = new DataInputStream(clientSocket.getInputStream());
out = new DataOutputStream(clientSocket.getOutputStream());
String message;
while (true) {
// as soon as a message is being received, print it out!
message = in.readUTF();
System.out.println("Server received: " + message);
// send a message confirmation to the client
String temp1 = "Server: I received your message of " + "'" + message + "'";
out.writeUTF(temp1);
}
}
catch(IOException e) {
System.out.println("problem with networking: " + e);
}
}
}
package MV3500Cohort2018JanuaryMarch.homework1;
//package tcpclient;
import java.io.*;
import java.net.*;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.util.Scanner;
/**
* Before, we always used telnet to connect to the server. We
* are now writing our own program to do the connection.
*
* As you will see, when we run this after we start the server
* we will see the same string telnet printed, sent by the server.
* The output at the server will show different socket pairs for
* each time we ran it.
*
* @author mcgredo
*/
public class MaroonTcpClient {
public static DataInputStream input;
public static DataOutputStream output;
public static void main(String[] args)
{
Scanner userInput = new Scanner(System.in);
try
{
System.out.println("creating socket");
Socket socket = new Socket("localhost", 2317);
input = new DataInputStream(socket.getInputStream());
output = new DataOutputStream(socket.getOutputStream());
System.out.println("Type position or ID: \n ");
String request;
request = userInput.nextLine();
output.writeUTF(request);
String reply;
reply = input.readUTF();
System.out.println(reply);
}
catch(Exception e)
{
System.out.println(e);
System.out.println("Problem with client");
}
}
}
//package tcpclient;
import java.io.*;
import java.net.*;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.util.Scanner;
/**
* Before, we always used telnet to connect to the server. We
* are now writing our own program to do the connection.
*
* As you will see, when we run this after we start the server
* we will see the same string telnet printed, sent by the server.
* The output at the server will show different socket pairs for
* each time we ran it.
*
* @author mcgredo
*/
public class MaroonTcpClient
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public MaroonTcpClient ()
{
// default initializations
}
static DataInputStream input;
static DataOutputStream output;
/** run the program
* @param args command-line arguments, string parameters (unused) */
public static void main(String[] args)
{
Scanner userInput = new Scanner(System.in);
try
{
System.out.println("creating socket");
Socket socket = new Socket("localhost", 2317);
input = new DataInputStream(socket.getInputStream());
output = new DataOutputStream(socket.getOutputStream());
System.out.println("Type position or ID: \n ");
String request;
request = userInput.nextLine();
output.writeUTF(request);
String reply;
reply = input.readUTF();
System.out.println(reply);
}
catch(Exception e)
{
System.out.println(e);
System.out.println("Problem with client");
}
}
}
package MV3500Cohort2018JanuaryMarch.homework1;
//package tcpserver;
import java.io.*;
import java.net.*;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Arrays;
/**
* Very slightly more complex than example1. A complete copy of
* example 2. The only thing this does
* differently is introduce a loop into the response, so you don't
* have to restart the program after one response. Also, it prints
* out the socket pair the server sees. Run the program via telnet
* several times and compare the socket pairs.
*
* telnet localhost 2317
*
* If you're sophisticated you can contact the instructor's computer
* while running this program.
*
* telnet <ipOfServersLaptop> 2317
*
* And have him display the socket pairs he got.
* @author mcgredo
*/
public class MaroonTcpServer
{
public static DataInputStream input;
public static DataOutputStream output;
public static void main(String[] args)
{
MaroonUnit testUnit1 = new MaroonUnit ();
try
{
// ServerSocket waits for a connection from a client.
// Notice that it is outside the loop; ServerSocket
// needs to be made only once.
ServerSocket serverSocket = new ServerSocket(2317);
// Loop, infinitely, waiting for client connections.
// Stop the program somewhere else.
while(true)
{
Socket clientConnection = serverSocket.accept();
//OutputStream os = clientConnection.getOutputStream();
input = new DataInputStream(clientConnection.getInputStream());
output = new DataOutputStream(clientConnection.getOutputStream());
String request = input.readUTF();
request = request.trim(); // get rid of outer whitespace
if ("position".equalsIgnoreCase(request)){
output.writeUTF(Arrays.toString(testUnit1.getPosition()));
}
else if ("ID".equalsIgnoreCase(request)){
output.writeUTF(""+ testUnit1.getID());
}else
output.writeUTF("I don't understand, try www.google.com");
// Notice the use of flush() and close(). Without
// the close() to Socket object may stay open for
// a while after the client has stopped needing this
// connection. Close() explicitly ends the connection.
clientConnection.close();
}
}
catch(Exception e)
{
System.out.println("problem with networking");
}
}
//package tcpserver;
import java.io.*;
import java.net.*;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Arrays;
/**
* Very slightly more complex than example1. A complete copy of
* example 2. The only thing this does
* differently is introduce a loop into the response, so you don't
* have to restart the program after one response. Also, it prints
* out the socket pair the server sees. Run the program via telnet
* several times and compare the socket pairs.
*
* telnet localhost 2317
*
* If you're sophisticated you can contact the instructor's computer
* while running this program.
*
* telnet [ipAddressOfServerLaptop] 2317
*
* And have him display the socket pairs he got.
* @author mcgredo
*/
public class MaroonTcpServer
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public MaroonTcpServer ()
{
// default initializations
}
static DataInputStream input;
static DataOutputStream output;
/** run the program
* @param args command-line arguments, string parameters (unused) */
public static void main(String[] args)
{
MaroonUnit testUnit1 = new MaroonUnit ();
try
{
// ServerSocket waits for a connection from a client.
// Notice that it is outside the loop; ServerSocket
// needs to be made only once.
ServerSocket serverSocket = new ServerSocket(2317);
// Loop, infinitely, waiting for client connections.
// Stop the program somewhere else.
while(true)
{
Socket clientConnection = serverSocket.accept();
//OutputStream os = clientConnection.getOutputStream();
input = new DataInputStream(clientConnection.getInputStream());
output = new DataOutputStream(clientConnection.getOutputStream());
String request = input.readUTF();
request = request.trim(); // get rid of outer whitespace
if ("position".equalsIgnoreCase(request)){
output.writeUTF(Arrays.toString(testUnit1.getPosition()));
}
else if ("ID".equalsIgnoreCase(request)){
output.writeUTF(""+ testUnit1.getID());
}else
output.writeUTF("I don't understand, try www.google.com");
// Notice the use of flush() and close(). Without
// the close() to Socket object may stay open for
// a while after the client has stopped needing this
// connection. Close() explicitly ends the connection.
clientConnection.close();
}
}
catch(Exception e)
{
System.out.println("problem with networking");
}
}
}
\ No newline at end of file
package MV3500Cohort2018JanuaryMarch.homework1;
//package Assignment01;
import java.io.*;
import java.net.*;
/**
*
* @author Jeremiah Sasala
*/
public class SasalaClient {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
while(true){
try
{
System.out.println("-------------------------------------------------------------------");
// from the server, instead of one only.
Socket socket = new Socket("127.0.0.1", 2317);
InputStream is = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String serverMessage01 = br.readLine();
String serverMessage02 = br.readLine();
String serverMessage03 = br.readLine();
String serverMessage04 = br.readLine();
String serverMessage05 = br.readLine();
System.out.println("The message the server sent was . . . " + serverMessage01);
System.out.println("The message the server sent was . . . " + serverMessage02);
System.out.println("The message the server sent was . . . " + serverMessage03);
System.out.println("The message the server sent was . . . " + serverMessage04);
System.out.println("The message the server sent was . . . " + serverMessage05);
}
catch(Exception e)
{
System.out.println("Problem with client");
System.out.println(e);
}
}
}
}
//package Assignment01;
import java.io.*;
import java.net.*;
/**
* homework assignment
* @author Jeremiah Sasala
*/
public class SasalaClient
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public SasalaClient ()
{
// default initializations
}
/**
* Program invocation, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
while(true){
try
{
System.out.println("-------------------------------------------------------------------");
// from the server, instead of one only.
Socket socket = new Socket("127.0.0.1", 2317);
InputStream is = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String serverMessage01 = br.readLine();
String serverMessage02 = br.readLine();
String serverMessage03 = br.readLine();
String serverMessage04 = br.readLine();
String serverMessage05 = br.readLine();
System.out.println("The message the server sent was . . . " + serverMessage01);
System.out.println("The message the server sent was . . . " + serverMessage02);
System.out.println("The message the server sent was . . . " + serverMessage03);
System.out.println("The message the server sent was . . . " + serverMessage04);
System.out.println("The message the server sent was . . . " + serverMessage05);
}
catch(Exception e)
{
System.out.println("Problem with client");
System.out.println(e);
}
}
}
}
package MV3500Cohort2018JanuaryMarch.homework1;
//package Assignment01;
import java.io.*;
import java.net.*;
/**
*
* @author Jeremiah Sasala
*/
public class SasalaServer {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try
{
ServerSocket serverSocket = new ServerSocket(2317);
while(true)
{
Socket clientConnection = serverSocket.accept();
OutputStream os = clientConnection.getOutputStream();
PrintStream ps = new PrintStream(os);
String entityName = "Ranger";
double xPos = Math.round(Math.random()*10);
double yPos = Math.round(Math.random()*10);
double zPos = Math.round(Math.random()*10);
ps.println("Entity position information");
ps.println("Name: " + entityName);
ps.println("X coordinate: " + xPos);
ps.println("Y coordinate: " + yPos);
ps.println("Z coordinate: " + zPos);
InetAddress localAddress = clientConnection.getLocalAddress();
InetAddress remoteAddress = clientConnection.getInetAddress();
int localPort = clientConnection.getLocalPort();
int remotePort = clientConnection.getPort();
System.out.println("Socket pair: (( " + localAddress.toString() + ", " + localPort + " ), ( " +
remoteAddress.toString() + ", " + remotePort + " ))");
ps.flush();
clientConnection.close();
}
}
catch(Exception e)
{
System.out.println("problem with networking: " + e);
}
}
}
//package Assignment01;
import java.io.*;
import java.net.*;
/**
* homework assignment
* @author Jeremiah Sasala
*/
public class SasalaServer
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public SasalaServer ()
{
// default initializations
}
/**
* Program invocation, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args) {
try
{
ServerSocket serverSocket = new ServerSocket(2317);
while(true)
{
Socket clientConnection = serverSocket.accept();
OutputStream os = clientConnection.getOutputStream();
PrintStream ps = new PrintStream(os);
String entityName = "Ranger";
double xPos = Math.round(Math.random()*10);
double yPos = Math.round(Math.random()*10);
double zPos = Math.round(Math.random()*10);
ps.println("Entity position information");
ps.println("Name: " + entityName);
ps.println("X coordinate: " + xPos);
ps.println("Y coordinate: " + yPos);
ps.println("Z coordinate: " + zPos);
InetAddress localAddress = clientConnection.getLocalAddress();
InetAddress remoteAddress = clientConnection.getInetAddress();
int localPort = clientConnection.getLocalPort();
int remotePort = clientConnection.getPort();
System.out.println("Socket pair: (( " + localAddress.toString() + ", " + localPort + " ), ( " +
remoteAddress.toString() + ", " + remotePort + " ))");
ps.flush();
clientConnection.close();
}
}
catch(Exception e)
{
System.out.println("problem with networking: " + e);
}
}
}
package MV3500Cohort2018JanuaryMarch.homework1;
//package PositionClient;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
/**
*
* @author AJSNELL
*/
public class SnellPositionClient {
/**
* @param args the command line arguments
* @throws java.io.IOException
*/
public static void main(String[] args) throws IOException {
String hostName = args[0];
try (Socket clientSocket = new Socket(hostName, 8005);
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in))) {
String userInput;
out.println("unit id: 1\nunit pos: 11S MS 4859 9849");
while ((userInput = stdIn.readLine()) != null) {
out.println(userInput);
System.out.println("from client: " + in.readLine());
}
} catch (UnknownHostException e) {
System.err.println("Don't know about host " + hostName);
System.exit(1);
} catch (IOException e) {
System.err.println("Couldn't get I/O for the connection to " + hostName);
System.exit(1);
}
}
//package PositionClient;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
/**
* homework assignment
* @author AJSNELL
*/
public class SnellPositionClient
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public SnellPositionClient ()
{
// default initializations
}
/**
* Program invocation, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
String hostName = args[0]; // poor practice, ought to throw meaningful exception message
try (Socket clientSocket = new Socket(hostName, 8005);
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in))) {
String userInput;
out.println("unit id: 1\nunit pos: 11S MS 4859 9849");
while ((userInput = stdIn.readLine()) != null) {
out.println(userInput);
System.out.println("from client: " + in.readLine());
}
} catch (UnknownHostException e) {
System.err.println("Don't know about host " + hostName);
System.exit(1);
} catch (IOException e) {
System.err.println("Couldn't get I/O for the connection to " + hostName);
System.exit(1);
}
}
}
\ No newline at end of file
package MV3500Cohort2018JanuaryMarch.homework1;
//package positionserver;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.io.PrintWriter;
public class SnellPositionServer {
/**
* @param args the command line arguments
* @throws java.io.IOException
*/
public static void main(String[] args) throws IOException {
try (ServerSocket serverSocket = new ServerSocket(8005);
Socket clientSocket = serverSocket.accept();
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));) {
System.out.println("Client connected on port 8005");
String inputLine;
while ((inputLine = in.readLine()) != null) {
System.out.println("Received message: " + inputLine + " from " + clientSocket.toString());
out.println(inputLine);
}
} catch (IOException e) {
System.out.println("Exception when trying to listen on port 8005");
}
}
//package positionserver;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.io.PrintWriter;
/** Program description goes here */
public class SnellPositionServer
{
/**
* Default constructor to silence javadoc warning
* @see <a href="https://stackoverflow.com/questions/4488716/java-default-constructor" target="_blank">StackOverflow: Java default constructor</a>
*/
public SnellPositionServer ()
{
// default initializations
}
/**
* Program invocation, execution starts here
* @param args command-line arguments
*/
public static void main(String[] args)
{
try (ServerSocket serverSocket = new ServerSocket(8005);
Socket clientSocket = serverSocket.accept();
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));) {
System.out.println("Client connected on port 8005");
String inputLine;
while ((inputLine = in.readLine()) != null) {
System.out.println("Received message: " + inputLine + " from " + clientSocket.toString());
out.println(inputLine);
}
} catch (IOException e) {
System.out.println("Exception when trying to listen on port 8005");
}
}
}
\ No newline at end of file